MediaWiki:Common.js
跳到导航
跳到搜索
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
/* 此处的JavaScript将加载于所有用户每一个页面。 */
/* 在页面右边显示滑动按钮,点击跳到顶部/底部。 */
var suspendcode="<DIV id=backi style='position:fixed;right:0px;top:200px;'><a href='#top' title='顶部'><font color=red>▲</font></a><br><a href='#bottom' title='底部' onClick='window.scrollTo(0,10000);'><font color=red>▼</font></a></div>";
document.write(suspendcode);
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.backi.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);