93、鼠标操作页面滚动

93、鼠标操作页面滚动

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript">

var currentpos,timer;

function initialize()

{

timer=setInterval("scrollwindow()",100);

}

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

</script>

 

Write a comment

Comments: 0