双击鼠标滚动屏幕的代码

uploads/200509/10_095856_eb4h6.gif

将下面的代码复制到<body></body>之间,就可以在网页实现双击鼠标左键滚动屏幕了!

<script language=JavaScript>
var currentpos,timer;function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}

function sc()
{
clearInterval(timer);
}

function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}

document.onmousedown=sc
document.ondblclick=initialize

<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {
if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth;
document.MM_pgH=innerHeight;
onresize=MM_reloadPage;
}
}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}

MM_reloadPage(true);
//-->
</script>

发表评论