PageSourceSearch

https://textiledictionary.com/themes/textiledictionarycom/assets/js/main.js

js textiledictionary.com collected 2026-10-03 18:37:15 UTC 920 bytes, 29 lines download raw bytes

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.