1$(window).scroll(function() { 2 var body = $("body"); 3 if ($(this).scrollTop() > $(".menu-bar").position().top) { 4 body.addClass("cd-scroll"); 5 } else { 6 body.removeClass("cd-scroll"); 7 } 8 if ($(this).scrollTop() > $(".mobile-menu-bar").position().top) { 9 body.addClass("cd-scrollMobile"); 10 } else { 11 body.removeClass("cd-scrollMobile"); 12 } 13}); 14function topFunction() { 15 $('html, body').animate({scrollTop: 0}, 1200); 16} 17function toggleMobileMenu(event) { 18 event.stopPropagation(); 19 20 document.body.classList.toggle('cd-mobile-menu-open'); 21 22 // if ($(document.body).hasClass('cd-mobile-menu-open')) { 23 // var y = window.scrollY; 24 // document.body.style.top = '-' + y + 'px'; 25 // document.body.style.position = 'fixed'; 26 // } else { 27 // const scrollY = document.body.style.top; 28 // document.body.style.position = ''; 29 // document.body.style.top = ''; 30 // window.scrollTo(0, parseInt(scrollY || '0') * -1); 31 // } 32 33 var navIcons = document.getElementsByClassName("nav-icon");
34 Object.keys(navIcons).forEach(function (key) { 35 navIcons[key].classList.toggle('open'); 36 }); 37 38 document.getElementsByClassName("cd-mobile-menu-level-1")[0].classList.toggle('open'); 39 $( ".cd-mobile-menu-background" ).toggle(); 40} 41 42$(".cd-mobile-menu").find(".cd-menu-expand").click(function( event ) { 43 event.preventDefault(); 44 event.stopPropagation(); 45 46 var clickedEntry = event.target; 47 if (!(event.target instanceof HTMLAnchorElement)) { 48 clickedEntry = event.target.parentElement; 49 } 50 51 $(clickedEntry).toggleClass("active"); 52 $(clickedEntry.nextElementSibling).children("ul").slideToggle(); 53 54 $(clickedEntry.parentElement).siblings().each(function() { 55 $(this).children("a").removeClass("active"); 56 $(this).children("div").each(function() { 57 $(this).children("ul").each(function () { 58 if ($(this).is(":visible")) { 59 $(this).slideToggle(); 60 } 61 }) 62 }); 63 }); 64}); 65 66$(document).click(function(event) { 67 if ($(document.body).hasClass('cd-mobile-menu-open') && event.target.tagName.toLowerCase() === 'a') { 68 toggleMobileMenu(event); 69 } 70});
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.