MediaWiki:Common.js

SakiWiki:《咲-Saki-》中文百科全书。
YOYO(讨论 | 贡献)2012年8月8日 (三) 16:50的版本
跳到导航 跳到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • 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;_position:absolute;z-index:999;right:0px;top:200px;font-size:10px;'><a href='#top' title='顶部'>▲</a><br><a href='#bottom' title='底部' onClick='window.scrollTo(0,10000);'>▼</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);