87,994
社区成员
发帖
与我相关
我的任务
分享<script language="JavaScript">
function click() {
if (event.button==2) {
if(document.all.auto.status==true){document.all.auto.status=false;alert("自动滚屏已经停止了!")}
scroller();
}
}
document.onmousedown=click
var position = 0;
function scroller() {
if (document.all.auto.status==true){
position++;
scroll(0,position);
clearTimeout(timer);
var timer = setTimeout("scroller()",50);
timer;
}
else{
clearTimeout(timer);
}
}
</script>
<script language="JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
<div align="right">
<input type="checkbox" name="auto" value="on" onClick="MM_callJS('scroller() ; ')" >自动滚屏(右键暂停)</div>
var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",10);
}
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