“MediaWiki:Common.js”的版本间差异
来自仁王 wiki
(添加 把导航栏左侧仁王1和仁王2变为可用超链接) |
|||
第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | /* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | ||
− | console.log("已触发MediaWiki:Common.js"); | + | //console.log("已触发MediaWiki:Common.js"); |
//window.onload = function () { | //window.onload = function () { | ||
− | console.log("onload触发"); | + | //console.log("onload触发"); |
var div = document.createElement("div"); | var div = document.createElement("div"); | ||
div.style.backgroundColor = "steelblue"; | div.style.backgroundColor = "steelblue"; | ||
第23行: | 第23行: | ||
document.documentElement.scrollTop > document.documentElement.clientHeight ? div.style.display = "block":div.style.display = "none";}); | document.documentElement.scrollTop > document.documentElement.clientHeight ? div.style.display = "block":div.style.display = "none";}); | ||
//} | //} | ||
+ | |||
+ | /* 把导航栏左侧仁王1和仁王2变为可用超链接 */ | ||
+ | |||
+ | var nioh1 = document.getElementById("p-.E4.BB.81.E7.8E.8B1-label"); | ||
+ | nioh1.style.cursor="pointer"; | ||
+ | nioh1.style.color="#36c"; | ||
+ | var nioh2 = document.getElementById("p-.E4.BB.81.E7.8E.8B2-label"); | ||
+ | nioh1.style.cursor="pointer"; | ||
+ | nioh1.style.color="#36c"; |
2021年3月1日 (一) 20:31的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ //console.log("已触发MediaWiki:Common.js"); //window.onload = function () { //console.log("onload触发"); var div = document.createElement("div"); div.style.backgroundColor = "steelblue"; div.style.position = "fixed"; div.style.textAlign = "center"; div.style.opacity = ".7"; div.style.width = "40px"; div.style.height = "40px"; div.style.bottom = "100px"; div.style.right = "50px"; div.style.display = "none"; div.innerHTML = '<a href="#" style="color:white">返回顶部</a>'; var i = document.getElementById("mw-footer-container"); i.parentNode.insertBefore(div,i); document.body.addEventListener("wheel",function () { console.log("滚动条"); document.documentElement.scrollTop > document.documentElement.clientHeight ? div.style.display = "block":div.style.display = "none";}); //} /* 把导航栏左侧仁王1和仁王2变为可用超链接 */ var nioh1 = document.getElementById("p-.E4.BB.81.E7.8E.8B1-label"); nioh1.style.cursor="pointer"; nioh1.style.color="#36c"; var nioh2 = document.getElementById("p-.E4.BB.81.E7.8E.8B2-label"); nioh1.style.cursor="pointer"; nioh1.style.color="#36c";