“MediaWiki:Common.js”的版本间差异

来自仁王 wiki
第18行: 第18行:
 
i.parentNode.insertBefore(div,i);
 
i.parentNode.insertBefore(div,i);
  
   window.body.addEventListener("wheel",function () {
+
   document.body.addEventListener("wheel",function () {
 
     consol.log("滚动条动了");
 
     consol.log("滚动条动了");
 
   });
 
   });
 
}
 
}

2021年2月26日 (五) 17:30的版本

/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */

window.onload = function () {
console.log("已触发MediaWiki:Common.js");
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.block = "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 () {
    consol.log("滚动条动了");
  });
}