By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,156 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,156 IT Pros & Developers. It's quick & easy.

automatically scrolling down the page to the bottom after adding data to it by xmlhttpreq object?

P: n/a
Hi guys,
I have some problem about my little http/javascript/xmlhttpreq based
chatroom program:
I use xmlhttpreq object to add data to the current html file.
It will add to a specifiy place, like after a tag or before a tag
And if it adds too many data after that tag, the whole page will become
big and need to scroll down to see the latest added data
how to let it scroll down automatically without any annoying scrolling
down?

One way I can use is to use a anchor which is at the bottom of that
page and after i put my data into the textbox and click the link( which
is linked to proper file to process the data but also point to the
anchor) the page will show from the bottom. but the whole page will
first jump up a little space then jump down. It's annoying too :(

Any1 has idea?

Deryk

Nov 9 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
zh******@gmail.com wrote:
Hi guys,
I have some problem about my little http/javascript/xmlhttpreq based
chatroom program:
I use xmlhttpreq object to add data to the current html file.
It will add to a specifiy place, like after a tag or before a tag
And if it adds too many data after that tag, the whole page will become
big and need to scroll down to see the latest added data
how to let it scroll down automatically without any annoying scrolling
down?

One way I can use is to use a anchor which is at the bottom of that
page and after i put my data into the textbox and click the link( which
is linked to proper file to process the data but also point to the
anchor) the page will show from the bottom. but the whole page will
first jump up a little space then jump down. It's annoying too :(

Any1 has idea?


Without seeing your code, only guesses are possible.

You might try window.scrollBy() with suitable values - either calculated
or just some silly number for the y value like (0, 10000):

<URL:http://www.mozilla.org/docs/dom/domref/dom_window_ref106.html>

<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/scrollby.asp>
--
Rob
Nov 9 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.