当内容到达结尾时刷新内容 "div"
Refresh the content when it reaches to its end "div"
我希望我的页面在自动向下滚动后自动刷新...这是我关于如何自动向上和向下滚动的代码。
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed);
});
}
speed = 25000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2);
快速 fiddle:https://jsfiddle.net/manoeuvres/LbLaf8La/ 在第二个动画调用的 'action complete' 函数中添加了刷新调用 location.reload();
,因此当动画 returns到顶部。
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed, function(){ location.reload(); });
});
}
speed = 25000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2); // because the page is refreshing I don't think this line gets to get called. but no problem to leave it in.
我希望我的页面在自动向下滚动后自动刷新...这是我关于如何自动向上和向下滚动的代码。
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed);
});
}
speed = 25000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2);
快速 fiddle:https://jsfiddle.net/manoeuvres/LbLaf8La/ 在第二个动画调用的 'action complete' 函数中添加了刷新调用 location.reload();
,因此当动画 returns到顶部。
function scroll(speed) {
$('html, body').animate({ scrollTop: $(document).height() }, speed, function() {
$(this).animate({ scrollTop: 0 }, speed, function(){ location.reload(); });
});
}
speed = 25000;
scroll(speed)
setInterval(function(){scroll(speed)}, speed * 2); // because the page is refreshing I don't think this line gets to get called. but no problem to leave it in.