I have this code here: <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#load_news').load('ajax/news.php').fadeIn("slow"); }, 10000); // refresh every 10000 milliseconds </script> Code (markup): It is used to refresh data coming from news.php How come every time it refreshes the file it shoots me back to the top of the page? is there a way to stop that from happening?
http://datingsnap.com/index.php you have to login first. email: test@test.com pass: test You will be redirected to the user homepage. wait around 20 seconds and it will load news. Scroll down and when it refreshes the news file it shoots you back to the top of the page.
Adam, I have tried it in IE9 and FF4. On both browsers the scrollbar stays at the same place after refresh. Sorry, I can't simulate the error.
huh thats weird, I just tried it in FF also and it didn't do that. I tried once before and it had done it in FF. I am using Google Chrome though, and it happens on there. Any idea for a fix when using Google Chrome?
Scrollbar ussually goes top on: - page refresh - user moves to an anchor at top, - or there is scrollTop In your case I saw scrollTop is used in chat.js, so try to look at it.