MediaWiki:Common.js:修订间差异
跳转到导航
跳转到搜索
第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ | /* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ | ||
const nl_tb_headers = document.querySelectorAll('.nl-tb-header div'); | |||
const nl_tb_contents = document.querySelectorAll('.nl-tb-content div'); | |||
nl_tb_headers.forEach((nl_tb_header, index) => { | |||
nl_tb_header.addEventListener('click', () => { | |||
} | nl_tb_contents.forEach(item => item.classList.remove('active')); | ||
nl_tb_contents[index].classList.add('active'); | |||
}); | |||
}); |
2024年10月29日 (二) 20:29的版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ const nl_tb_headers = document.querySelectorAll('.nl-tb-header div'); const nl_tb_contents = document.querySelectorAll('.nl-tb-content div'); nl_tb_headers.forEach((nl_tb_header, index) => { nl_tb_header.addEventListener('click', () => { nl_tb_contents.forEach(item => item.classList.remove('active')); nl_tb_contents[index].classList.add('active'); }); });