...

View Full Version : scroll to bottom on load



singedpiper
07-20-2005, 06:54 AM
i need a page to load scrolled to the bottom... and do it on auto-refresh

i have a page that auto-refreshes every five seconds, and I need it to scroll to the bottom of the page at every refresh... regardless of whether the page stays the same length (dynamic content).

i.e. a shoutbox that checks for new shouts every 5 seconds.

is there a way?

]|V|[agnus
07-20-2005, 07:03 AM
Yes, but that would be a Javascript question.

However, I gotta wonder: why not just sort them in descending order? It seems to me the repeated scrolling would get annoying, not to mention tedious after many records are returned.

_Aerospace_Eng_
07-20-2005, 07:12 AM
Magnus has a good point but if you want to do it, add this to your body tag in the page you want scrolled to the bottom.

onload="window.scrollTo(0,document['body'].offsetHeight);"

singedpiper
07-20-2005, 07:21 AM
the reason is to have an im styled interface where the input is at the bottom and the posts are in reverse order above it... either way scrolling will be necessary, the question is simply will it be up or down.

singedpiper
07-20-2005, 10:37 AM
i messed up when asking the question... rather than having the window scroll, i need the div with the id "CONTENT" to scroll. how can i do this?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum