1(function($){ 2// Auto Hiding Navbar on Scroll 3var AutoHidingNavbar = function() { 4 5 // Handle Auto Hiding Navbar on Scroll 6 var handleAutoHidingNavbar = function() { 7 $(function() { 8 // Hide Header on on scroll down 9 var didScroll; 10 var lastScrollTop = 0; 11 var startScrollTop = 151; 12 var delta = 5; 13 var navbarHeight; 14 15 $(window).scroll(function(event) { 16 didScroll = true; 17 navbarHeight = $('.auto-hiding-navbar').outerHeight(); 18 }); 19 20 setInterval(function() { 21 if (didScroll) { 22 hasScrolled(); 23 didScroll = false; 24 } 25 }, 250); 26 27 function hasScrolled() { 28 var st = $(this).scrollTop(); 29 30 // Make sure they scroll more than delta 31 if (Math.abs(lastScrollTop - st) <= delta) 32 return; 33 34 // If they scrolled down and are past the navbar, add class .nav-up. 35 // This is necessary so you never see what is "behind" the navbar. 36 if (st > lastScrollTop && st > navbarHeight) { 37 // Scroll Down 38 $('.auto-hiding-navbar').removeClass('nav-down').addClass('nav-up'); 39 } else { 40 // Scroll Up 41 if (st + $(window).height() < $(document).height()) { 42 $('.auto-hiding-navbar').removeClass('nav-up').addClass('nav-down'); 43 } 44 } 45 46 lastScrollTop = st; 47 } 48 }); 49 }; 50 51 return { 52 init: function() { 53 handleAutoHidingNavbar(); // initial setup for auto hiding navbar on scroll 54 } 55 } 56}(); 57 58$(document).ready(function() { 59 AutoHidingNavbar.init(); 60}); 61})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.