1//导èªäºçº§èå 2function ds_mainmenu(ulclass) { 3 document.addEventListener("DOMContentLoaded", function () { 4 document.querySelectorAll(ulclass + " li").forEach(function (li) { 5 li.addEventListener("mouseenter", function () { 6 let submenu = li.querySelector("ul"); 7 if (submenu) submenu.style.display = "block"; 8 }); 9 li.addEventListener("mouseleave", function () { 10 let submenu = li.querySelector("ul"); 11 if (submenu) submenu.style.display = "none"; 12 }); 13 }); 14 }); 15} 16ds_mainmenu(".header-menu-ul"); 17 18 19 20/*å·æ°é¡µé¢ajaxloading*/ 21document.addEventListener("DOMContentLoaded", function () { 22 document.body.classList.add("ajaxloading"); 23 setTimeout(function () { 24 document.body.classList.remove("ajaxloading"); 25 }, 500); 26}); 27 28 29 30//tableé¢è®¾calss 31document.querySelectorAll('.wznrys table').forEach(table => { 32 table.classList.add('table', 'text-nowrap'); 33 let wrapper = document.createElement('div'); 34 wrapper.className = 'overflow-x-auto'; 35 table.parentNode.insertBefore(wrapper, table); 36 wrapper.appendChild(table); 37}); 38 39 40//toc 41document.addEventListener('DOMContentLoaded', function () { 42 var box = document.querySelector('.text_name_box'); 43 var toc = document.getElementById('toc'); 44 if (!box || !toc) return; 45 var heads = box.querySelectorAll('h1,h2,h3,h4,h5,h6'); 46 if (!heads.length) return; 47 var ul = document.createElement('ul'); 48 heads.forEach(function (h, i) { 49 if (!h.id) h.id = 'toc-' + i; 50 var a = document.createElement('a'); 51 a.href = '#' + h.id; 52 a.textContent = h.textContent.trim(); 53 a.addEventListener('click', function (e) { 54 e.preventDefault(); 55 h.scrollIntoView({ behavior: 'smooth', block: 'start' }); 56 }); 57 var li = document.createElement('li'); 58 li.appendChild(a); 59 ul.appendChild(li); 60 }); 61 toc.innerHTML = ''; 62 toc.appendChild(ul); 63 var links = ul.querySelectorAll('a'); 64 function setActive() { 65 var bt = box.getBoundingClientRect().top; 66 var active = 0; 67 heads.forEach(function (h, i) { 68 if (h.getBoundingClientRect().top - bt <= 10) active = i; 69 }); 70 links.forEach(function (a, i) { 71 a.classList.toggle('active', i === active); 72 }); 73 } 74 box.addEventListener('scroll', setActive); 75 setActive(); 76}); 77 78/* ==================================================== 79 ç§»å¨ç«¯ Offcanvas èååçé©±å¨ (æ¿ä»£ Bootstrap) 80 ==================================================== */ 81document.addEventListener('DOMContentLoaded', function() { 82 var mobBtn = document.querySelector('.mobile-menu-btn'); 83 var mobNav = document.getElementById('mobile_right_nav'); 84 85 if(mobBtn && mobNav) { 86 // ç¹å»æ±å ¡æé®å±å¼èå 87 mobBtn.addEventListener('click', function(e) { 88 e.preventDefault(); 89 mobNav.classList.add('is-open'); 90 }); 91 92 // ç¹å» X æé®å ³éèå 93 var closeBtn = mobNav.querySelector('button[aria-label="Close"]'); 94 if(closeBtn) { 95 closeBtn.addEventListener('click', function() { 96 mobNav.classList.remove('is-open'); 97 }); 98 } 99 } 100}); 101 102/* ==================================================== 103 ä¿®å¤è±ç¦» Bootstrap åçé项å¡åæ¢ (Tabs) 104 ==================================================== */ 105document.addEventListener('DOMContentLoaded', function() { 106 const tabs = document.querySelectorAll('.jzt-conf-tabs .nav-link'); 107 108 // åªæå½å页é¢åå¨é项塿¶ææ§è¡ï¼é¿å å ¨å±æ¥é 109 if (tabs.length > 0) { 110 const panes = document.querySelectorAll('.tab-content .tab-pane'); 111
112 tabs.forEach(tab => { 113 tab.addEventListener('click', function(e) { 114 e.preventDefault(); 115 116 // 1. ç§»é¤ææé项å¡åå 容åºçé«äº®ä¸æ¾ç¤ºç¶æ 117 tabs.forEach(t => t.classList.remove('active')); 118 panes.forEach(p => p.classList.remove('active', 'show')); 119 120 // 2. æ¿æ´»å½åç¹å»çéé¡¹å¡ 121 this.classList.add('active'); 122 123 // 3. æ¾å°å¯¹åºçç®æ å 容åºå¹¶æ¾ç¤º 124 const targetId = this.getAttribute('data-bs-target'); 125 if (targetId) { 126 const targetPane = document.querySelector(targetId); 127 if (targetPane) { 128 targetPane.classList.add('active', 'show'); 129 } 130 } 131 }); 132 }); 133 } 134}); 135 136 137document.addEventListener('DOMContentLoaded', function() { 138 // 1. é¡¶é¨è·é©¬ç¯åå§å 139 if (document.querySelector('.jzt-ticker-swiper') && typeof Swiper !== 'undefined') { 140 new Swiper('.jzt-ticker-swiper', { 141 slidesPerView: 1.5, spaceBetween: 10, freeMode: true, 142 navigation: { nextEl: '.ticker-btn-next', prevEl: '.ticker-btn-prev' }, 143 breakpoints: { 768: { slidesPerView: 3.5 }, 1200: { slidesPerView: 5 } } 144 }); 145 } 146 147 // 2. ä½è²ç´æå¤§å Tab è¿æ»¤é»è¾ (ä¸é´å¤§å ) 148 const hallTabs = document.querySelectorAll('#jzt-home-tabs li'); 149 const mixItems = document.querySelectorAll('.mix-item'); 150 hallTabs.forEach(tab => { 151 tab.addEventListener('click', function() { 152 hallTabs.forEach(t => t.classList.remove('active')); 153 this.classList.add('active'); 154 const filter = this.getAttribute('data-filter'); 155 mixItems.forEach(item => { 156 item.style.display = (filter === 'all' || item.classList.contains('mix-' + filter)) ? 'flex' : 'none'; 157 }); 158 }); 159 }); 160 161 // 3. ð¥ æ°å¢ï¼ä¾§è¾¹æ ç§¯åæ¦åæ¢é»è¾ (è§£å³ä¸è¶ ç¹å»æ²¡ååº) 162 const sideTabs = document.querySelectorAll('.side-tabs-mini span'); 163 sideTabs.forEach(tab => { 164 tab.addEventListener('click', function() { 165 const targetId = this.getAttribute('data-tab'); 166 const parent = this.closest('.side-widget'); 167 168 // 忢æé®é«äº® 169 sideTabs.forEach(s => s.classList.remove('active')); 170 this.classList.add('active'); 171 172 // 忢å 容æ¾é 173 parent.querySelectorAll('.s-tab-pane').forEach(pane => { 174 pane.classList.remove('active'); 175 pane.style.display = 'none'; 176 }); 177 const activePane = document.getElementById(targetId); 178 if(activePane) { 179 activePane.classList.add('active'); 180 activePane.style.display = 'block'; 181 } 182 }); 183 }); 184});
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.