双击滚动,单击停止

<html>
<head></head>
<body>
<div id="time"></div>
<a href="###">测试</a>
<div style="height:500px;"></div>
<div style="height:500px;"></div>
<script type='text/javascript'>
var shida_top, timer;

function shida_stop() {
    timer = setInterval("shida_scrollwindow()", 1);
}

function shida_start() {
    clearInterval(timer);
}

function shida_scrollwindow() {
    shida_top = document.body.scrollTop;
    window.scroll(0, ++shida_top);
    if (shida_top != document.body.scrollTop) shida_start();
}
document.onmousedown = shida_start;
document.ondblclick = shida_stop;
</script>
</body>
</html>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

相关文章

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部