双击鼠标滚动屏幕的代码

将如下代码插入至<hrad>……</head>中即可实现双击鼠标自动滚动屏幕

<script language="JavaScript" type="text/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
</script>
原文链接: http://blog.csdn.net/vince6799/article/details/706642

你可能感兴趣的:(双击鼠标滚动屏幕的代码)