1jQuery(document).ready(function( $ ) { 2 3 var notificationCookie = Cookies.get('notifications_status'); // => 'value' 4 5 $('#mobile-menu a').on('click', function(e){ 6 e.preventDefault(); 7 $('body').addClass('navigation-open'); 8 $('#mobile-navigation').addClass('active'); 9 10 }); 11 12 if(notificationCookie != 'hide'){ 13 $('#notification-banner').addClass('active'); 14 }; 15 16 $('.btn-close').on('click', function(e){ 17 e.preventDefault(); 18 $('#notification-banner').slideUp(300, function(){ 19 Cookies.set('notifications_status', 'hide', { expires: 1 }); 20 }); 21 }); 22 23 24 25 /// Mobile-nav 26 27 var isNavActive = false; 28 29 $(document).on('click','.tcon', function(){ 30 showMobileNav(); 31 }); 32 33// $('#mobile-nav-wrapper a').on("click", function(e){ 34// showMobileNav(); 35// }); 36 37 38 39 40 function showMobileNav(){ 41 42 if(isNavActive == false) { 43 isNavActive = true; 44 $('body').addClass('navigation-open'); 45 TweenMax.staggerFrom($('#mobile-nav-wrapper li'), 1, {y: 250, opacity:0,delay:0, ease:Power4.easeOut, force3D:true}, 0.01); 46 console.log(isNavActive); 47 } else { 48 isNavActive = false; 49 $('body').removeClass('navigation-open'); 50 console.log(isNavActive); 51 } 52 $('.tcon').toggleClass('tcon-transform'); 53 $('#main-logo').toggleClass('active'); 54 $('#mobile-nav-wrapper').toggleClass('active'); 55 56 } 57 58 $('#mobile-nav-wrapper .menu-item-has-children > a').on('click', function(e){ 59 e.preventDefault(); 60 var parentLi = $(this).parent(); 61 parentLi.toggleClass('active'); 62 $('ul.sub-menu', parentLi).slideToggle(); 63 }); 64 65 66 67 68 69 /*var didScroll; 70 var lastScrollTop = 0; 71 var delta = 5; 72 var navbarHeight = $('#top-navigation').outerHeight(); 73 74 $(window).scroll(function(event){ 75 didScroll = true; 76 }); 77 78 setInterval(function() { 79 if (didScroll) { 80 hasScrolled(); 81 didScroll = false; 82 } 83 }, 250); 84 85 function hasScrolled() { 86 var st = $(this).scrollTop(); 87 88 // Make sure they scroll more than delta 89 if(Math.abs(lastScrollTop - st) <= delta) 90 return; 91 92 // If they scrolled down and are past the navbar, add class .nav-up. 93 // This is necessary so you never see what is "behind" the navbar. 94 if (st > lastScrollTop && st > navbarHeight){ 95 // Scroll Down 96 $('#top-navigation').removeClass('nav-down').addClass('nav-up'); 97 $('body').find('#global_nav_la_4324422').removeClass('nav-down').addClass('nav-up'); 98 } else { 99 // Scroll Up 100 if(st + $(window).height() < $(document).height()) { 101 $('#top-navigation').removeClass('nav-up').addClass('nav-down'); 102 $('body').find('#global_nav_la_4324422').removeClass('nav-up').addClass('nav-down'); 103 } 104 } 105 106 lastScrollTop = st; 107 } 108 */ 109 110 111 112 113 114 var scrolling = false, 115 previousTop = 0, 116 currentTop = 0, 117 scrollDelta = 10, 118 scrollOffset = 100, 119 globalNavHeight = $('#global_navbar_la_4324422').outerHeight(), 120 navbarHeight = $('#top-navigation').outerHeight()+globalNavHeight; 121 122 123 $('#wrapper').css('margin-top',navbarHeight+'px'); 124 125 126 127 128 $(window).on('scroll', function(){ 129 if( !scrolling ) { 130 scrolling = true; 131 (!window.requestAnimationFrame) 132 ? setTimeout(autoHideHeader, 250) 133 : requestAnimationFrame(autoHideHeader); 134 } 135 }); 136 137 138 $(window).on('resize', function(){ 139 140 navHeight = $('#top-navigation').outerHeight() + $('#global_navbar_la_4324422').outerHeight(); 141 $('#wrapper').css('margin-top',navHeight+'px'); 142 143 console.log(navHeight); 144 145 }); 146 147 function autoHideHeader() { 148 var currentTop = $(window).scrollTop(); 149 150 if (previousTop - currentTop > scrollDelta) { 151 //if scrolling up... 152 $('#top-navigation').removeClass('nav-up').addClass('nav-down'); 153 $('body').find('#global_navbar_la_4324422').removeClass('nav-up').addClass('nav-down'); 154 } else if( currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { 155 //if scrolling down... 156 $('#top-navigation').removeClass('nav-down').addClass('nav-up'); 157 $('body').find('#global_navbar_la_4324422').removeClass('nav-down').addClass('nav-up'); 158 } 159 160 previousTop = currentTop; 161 scrolling = false;
162 } 163 164 /////PARALLAX 165 166 167// $("[data-paroller-factor]").paroller(); 168 169// var rellax = new Rellax('.rellax', { 170// center: true 171// }); 172 173 174});
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.