1/** 2 * Navigation JavaScript 3 * 4 * @package ADV_Wandson 5 * @since 1.0.0 6 */ 7 8(function($) { 9 'use strict'; 10 11 $(document).ready(function() { 12 /** 13 * Mobile Menu Toggle 14 */ 15 $('.toggleMenu').on('click', function(e) { 16 e.preventDefault(); 17 $('.nav').slideToggle('fast'); 18 $(this).toggleClass('active'); 19 }); 20 21 /** 22 * Close mobile menu when clicking outside 23 */ 24 $(document).on('click', function(e) { 25 if (!$(e.target).closest('.header').length) { 26 if ($('.nav').is(':visible') && $(window).width() <= 980) { 27 $('.nav').slideUp('fast'); 28 $('.toggleMenu').removeClass('active'); 29 } 30 } 31 }); 32 33 /** 34 * Reset menu on window resize 35 */ 36 $(window).on('resize', function() { 37 if ($(window).width() > 980) { 38 $('.nav').removeAttr('style'); 39 } 40 }); 41 42 /** 43 * Sticky Header 44 */ 45 if ($('#navbar').length) { 46 var navbar = $('#navbar')[0]; 47 var sticky = navbar.offsetTop; 48 49 $(window).on('scroll', function() { 50 if (window.pageYOffset >= sticky) { 51 $('#navbar').addClass('sticky1'); 52 } else { 53 $('#navbar').removeClass('sticky1'); 54 } 55 }); 56 } 57 }); 58 59})(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.