Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jumping to bottom of html page

Status
Not open for further replies.

n2ckb

Programmer
Jun 8, 2001
65
GB
Hi Guys,

I have a page within a frameset that refreshes each time a new message is posted. If the user is reading old messages, then the location of the scrollbar is saved, and on the refresh of the page the scrollbar position returns to where the user was reading. The problem that we have is if a new message is added and the user is at the bottom of the page waiting for a new message, we want the scroll bar to jump to the bottom to display the new message. Any ideas?

N
 
Keep things simple.
The most simple way to do what you want is to add an anchor to all message titles, and then reload a page with an anchor in page URL.
<a name=&quot;m7924&quot;>message 7924</a>
. . . message text

URL: some-firum-site/threadXXX.html#m7924

It is done like this on many forums and is the best - it combines great functionality with ease of implementation.
 
Thanks for your help Starway, but we also need to know how to check whether the user is at the bottom of the page. Is there a scrollheight value?

Excuse my ignorance, new to Javascript....

N
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top