1/* 主JSæä»¶ */ 2(function(){ 3 // ç§»å¨ç«¯èå 4 var btn = document.querySelector('.mobile-menu-btn'); 5 var nav = document.querySelector('.nav'); 6 if(btn && nav){ 7 btn.addEventListener('click', function(){ 8 nav.classList.toggle('open'); 9 }); 10 } 11 // æ»å¨ææ 12 var header = document.querySelector('.header'); 13 window.addEventListener('scroll', function(){ 14 if(window.scrollY > 50){ 15 if(header) header.style.boxShadow = '0 4px 24px rgba(0,0,0,0.15)'; 16 } else { 17 if(header) header.style.boxShadow = ''; 18 } 19 }); 20 // å¹³æ»æ»å¨ 21 document.querySelectorAll('a[href^="#"]').forEach(function(a){ 22 a.addEventListener('click', function(e){ 23 var id = this.getAttribute('href'); 24 if(id === '#') return; 25 var el = document.querySelector(id); 26 if(el){ e.preventDefault(); el.scrollIntoView({behavior:'smooth'}); } 27 }); 28 }); 29})();
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.