Guest User

Untitled

a guest
Oct 21st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. /*
  2. Spectral by HTML5 UP
  3. html5up.net | @ajlkn
  4. Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
  5. */
  6.  
  7. (function($) {
  8.  
  9. skel
  10. .breakpoints({
  11. xlarge: '(max-width: 1680px)',
  12. large: '(max-width: 1280px)',
  13. medium: '(max-width: 980px)',
  14. small: '(max-width: 736px)',
  15. xsmall: '(max-width: 480px)'
  16. });
  17.  
  18. $(function() {
  19.  
  20. var $window = $(window),
  21. $body = $('body'),
  22. $wrapper = $('#page-wrapper'),
  23. $banner = $('#banner'),
  24. $header = $('#header');
  25.  
  26. // Disable animations/transitions until the page has loaded.
  27. $body.addClass('is-loading');
  28.  
  29. $window.on('load', function() {
  30. window.setTimeout(function() {
  31. $body.removeClass('is-loading');
  32. }, 100);
  33. });
  34.  
  35. // Mobile?
  36. if (skel.vars.mobile)
  37. $body.addClass('is-mobile');
  38. else
  39. skel
  40. .on('-medium !medium', function() {
  41. $body.removeClass('is-mobile');
  42. })
  43. .on('+medium', function() {
  44. $body.addClass('is-mobile');
  45. });
  46.  
  47. // Fix: Placeholder polyfill.
  48. $('form').placeholder();
  49.  
  50. // Prioritize "important" elements on medium.
  51. skel.on('+medium -medium', function() {
  52. $.prioritize(
  53. '.important\\28 medium\\29',
  54. skel.breakpoint('medium').active
  55. );
  56. });
  57.  
  58. // Scrolly.
  59. $('.scrolly')
  60. .scrolly({
  61. speed: 1500,
  62. offset: $header.outerHeight()
  63. });
  64.  
  65. // Menu.
  66. $('#menu')
  67. .append('<a href="#menu" class="close"></a>')
  68. .appendTo($body)
  69. .panel({
  70. delay: 500,
  71. hideOnClick: true,
  72. hideOnSwipe: true,
  73. resetScroll: true,
  74. resetForms: true,
  75. side: 'right',
  76. target: $body,
  77. visibleClass: 'is-menu-visible'
  78. });
  79.  
  80. // Header.
  81. if (skel.vars.IEVersion < 9)
  82. $header.removeClass('alt');
  83.  
  84. if ($banner.length > 0
  85. && $header.hasClass('alt')) {
  86.  
  87. $window.on('resize', function() { $window.trigger('scroll'); });
  88.  
  89. $banner.scrollex({
  90. bottom: $header.outerHeight() + 1,
  91. terminate: function() { $header.removeClass('alt'); },
  92. enter: function() { $header.addClass('alt'); },
  93. leave: function() { $header.removeClass('alt'); }
  94. });
  95.  
  96. }
  97.  
  98. });
  99.  
  100. })(jQuery);
Add Comment
Please, Sign In to add comment