你好,我有自动滚动页面的工作代码。我需要做一些修改。当用户在页面上移动鼠标并且没有鼠标移动时,需要暂停自动滚动,然后自动滚动将恢复。当用户将鼠标移动到屏幕/图形上时,自动滚动将暂停。如果鼠标移动停止,自动滚动将再次恢复
<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
http://stackoverflow.com/questions/5088766/the-way-to-stop-and-continue-animation-while-mouseover-and -mouseout-in-jquery –
@Sarath http://jsfiddle.net/QUCWe/1605/ –