4 Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
\r
10 xlarge: '(max-width: 1680px)',
\r
11 large: '(max-width: 1280px)',
\r
12 medium: '(max-width: 980px)',
\r
13 small: '(max-width: 736px)',
\r
14 xsmall: '(max-width: 480px)'
\r
19 var $window = $(window),
\r
22 // Disable animations/transitions until the page has loaded.
\r
23 $body.addClass('is-loading');
\r
25 $window.on('load', function() {
\r
26 window.setTimeout(function() {
\r
27 $body.removeClass('is-loading');
\r
32 if (skel.vars.touch)
\r
33 $body.addClass('is-touch');
\r
36 var $form = $('form');
\r
38 // Auto-resizing textareas.
\r
39 $form.find('textarea').each(function() {
\r
41 var $this = $(this),
\r
42 $wrapper = $('<div class="textarea-wrapper"></div>'),
\r
43 $submits = $this.find('input[type="submit"]');
\r
48 .css('overflow', 'hidden')
\r
49 .css('resize', 'none')
\r
50 .on('keydown', function(event) {
\r
52 if (event.keyCode == 13
\r
55 event.preventDefault();
\r
56 event.stopPropagation();
\r
63 .on('blur focus', function() {
\r
64 $this.val($.trim($this.val()));
\r
66 .on('input blur focus --init', function() {
\r
69 .css('height', $this.height());
\r
72 .css('height', 'auto')
\r
73 .css('height', $this.prop('scrollHeight') + 'px');
\r
76 .on('keyup', function(event) {
\r
78 if (event.keyCode == 9)
\r
83 .triggerHandler('--init');
\r
86 if (skel.vars.browser == 'ie'
\r
87 || skel.vars.mobile)
\r
89 .css('max-height', '10em')
\r
90 .css('overflow-y', 'auto');
\r
94 // Fix: Placeholder polyfill.
\r
95 $form.placeholder();
\r
97 // Prioritize "important" elements on medium.
\r
98 skel.on('+medium -medium', function() {
\r
100 '.important\\28 medium\\29',
\r
101 skel.breakpoint('medium').active
\r
106 var $menu = $('#menu');
\r
108 $menu.wrapInner('<div class="inner"></div>');
\r
110 $menu._locked = false;
\r
112 $menu._lock = function() {
\r
117 $menu._locked = true;
\r
119 window.setTimeout(function() {
\r
120 $menu._locked = false;
\r
127 $menu._show = function() {
\r
130 $body.addClass('is-menu-visible');
\r
134 $menu._hide = function() {
\r
137 $body.removeClass('is-menu-visible');
\r
141 $menu._toggle = function() {
\r
144 $body.toggleClass('is-menu-visible');
\r
150 .on('click', function(event) {
\r
151 event.stopPropagation();
\r
153 .on('click', 'a', function(event) {
\r
155 var href = $(this).attr('href');
\r
157 event.preventDefault();
\r
158 event.stopPropagation();
\r
164 if (href == '#menu')
\r
167 window.setTimeout(function() {
\r
168 window.location.href = href;
\r
172 .append('<a class="close" href="#menu">Close</a>');
\r
175 .on('click', 'a[href="#menu"]', function(event) {
\r
177 event.stopPropagation();
\r
178 event.preventDefault();
\r
184 .on('click', function(event) {
\r
190 .on('keydown', function(event) {
\r
193 if (event.keyCode == 27)
\r