【发布时间】:2016-04-28 05:04:56
【问题描述】:
您好,我有用于自动滚动页面的工作代码。我需要对此进行一些修改。当用户在页面上移动鼠标时需要暂停自动滚动,当没有鼠标移动时,自动滚动将恢复。
<script>
$("html, body").animate({ scrollTop: $(document).height() }, 400000);
setTimeout(function() {
$('html, body').animate({scrollTop:0}, 400000);
},400000);
setInterval(function(){
// it will take 40 secound in total from the top of the page to the bottom
$("html, body").animate({ scrollTop: $(document).height() }, 400000);
setTimeout(function() {
$('html, body').animate({scrollTop:0}, 400000);
},400000);
},8000);
</script>
【问题讨论】:
-
请更新 html 或给我们一个 FIDDLE 以获得适当的帮助..
-
@Sarath jsfiddle.net/QUCWe/1605
标签: javascript jquery