注册 登录
编程论坛 ASP.NET技术论坛

求双击鼠标网页会向下慢慢移动的代码.....

twtdd 发布于 2008-06-27 14:52, 813 次点击
求双击鼠标网页会向下慢慢移动的代码.....
3 回复
#2
hebingbing2008-06-27 16:38
脚本说明:
把如下代码加入<body>区域中
<script language="javascript" type="text/javascript">
<!--
 

var cntr=0
var intervalid

var max_height=500 //the height of the page
    //adjust the max_height with the height of your page
     //It scrolls about 25 pixels per second
function do_scroll() {

cntr+=6
self.scroll(0,cntr)
if(cntr >max_height) {
cntr =-5
}
//restart the scrolling
if(cntr<0){
cntr+=6
}

}
//stop the scroll
function clear_interval(){
clearInterval(intervalid)
return false
}

function loop_scroll(){
intervalid=setInterval("do_scroll()",250)
status="!!!!!!!!!!! MOUSEOVER TO STOP AUTOSCROLL,MOUSEOUT TO RESTART !!!!!!!!!!!!"
return false
}

//-->
</script>

<script language="javascript">
<!--
document.onmouseover=clear_interval
document.onmouseout=loop_scroll
-->
</script>
#3
twtdd2008-06-29 10:56
谢谢了
#4
twtdd2008-06-29 11:09
那请问有VB代码不其所长不用HTML的可不可以
1