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

AJAX and scrolling layers problem

P: n/a
I have a layer, which is a DIV that has overflow set to "auto", so it
looks like a little pop-up window, even though it's just a layer.

So if the content of that window makes the user scroll down to read it,
and the user clicks a link while scrolled down, and the AJAX function
calls new data into that DIV, that data, if overflowed, will also be
scrolled down.

So basically it's like if you scrolled down to the bottom of slashdot.org,
clicked a link to usatoday.com, and when you got to usatoday.com, the page
was scrolled to the bottom of the page instead of at the top.

Any way I can make sure when the new data is written to the layer, that
the overflow scrolling is scrolled to the top of the layer?
--
Sugapablo
http://www.sugapablo.net

Jul 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Nevermind, found the answer:

var $obj = document.getElementById('whatever');

$obj.scrollTop = 0 - $obj.scrollHeight;

--
Sugapablo
http://www.sugapablo.net

Jul 20 '06 #2

P: n/a
Sugapablo wrote:
$obj.scrollTop = 0 - $obj.scrollHeight;
Why not just:

$obj.scrollTop = 0;

?

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jul 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.