部落与弯刀Wiki
搜索
登录
↓
个人工具
创建账户
登录
导航菜单
导航
汉家松鼠官网
首页
游戏介绍
MOD开发者手册
MOD开发教学视频
新闻(Steam)
讨论区(Steam)
创意工坊(Steam)
下载(Steam)
语言
简体中文
English
查看“MediaWiki:Common.js”的源代码
来自部落与弯刀Wiki
←
MediaWiki:Common.js
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于这些用户组的用户使用:
管理员
、
界面管理员
该页提供此wiki软件的界面文字,它已被保护以防止恶意修改。如欲修改所有wiki的翻译,请到
translatewiki.net
上的MediaWiki本地化计划。
您无权编辑此JavaScript页面,因为它可能会影响所有访问者。
您可以查看与复制此页面的源代码。
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ document.addEventListener("DOMContentLoaded", function () { const tocLinks = Array.from(document.querySelectorAll("#toc a")); const sections = tocLinks.map(link => { const hash = link.getAttribute("href").slice(1); const target = document.getElementById(hash) || document.querySelector(`[id="${CSS.escape(hash)}"]`); return target ? { link, target } : null; }).filter(Boolean); function updateHighlight() { const scrollY = window.scrollY + 120; let current = null; for (let section of sections) { if (section.target.offsetTop <= scrollY) { current = section; } else { break; } } tocLinks.forEach(l => l.classList.remove("active-section")); if (current) current.link.classList.add("active-section"); } updateHighlight(); window.addEventListener("scroll", updateHighlight); });
返回至
MediaWiki:Common.js
。