javascript - How to call reload after animation in JQuery -


i building news feed style page automatically scroll bottom, wait , refresh page , repeat process.

the automatic reload not working @ moment, , starting bug me.

any appreciated.

the scrolling part works great

my code

<script language="javascript" type="text/javascript"> function scrolll() {     time = $('.message').length*3000;     $("html, body").animate({ scrolltop: 0 }, 0);         $("html, body").animate({ scrolltop: $(document).height() }, time,0, function() {location.reload; });         ;     } </script> 

you can use

location.reload(); 

or

window.location.href = window.location.href; 

but think problem time,0

$("html, body").animate({ scrolltop: $(document).height() }, time, function() {location.reload(); }); 

and if understood can use settimeout()

$("html, body").animate({ scrolltop: $(document).height() }, 100, function() {          settimeout(function() {             location.reload();         }, time) }); 

demo


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -