How to reset persistent scrollbar position after div refresh in FF3?

Posted by rcon on Stack Overflow See other posts from Stack Overflow or by rcon
Published on 2010-04-22T20:29:43Z Indexed on 2010/04/22 20:33 UTC
Read the original article Hit count: 141

Filed under:
|
|
|

Hi, I'm experiencing a weird scrollbar issue. I'm building a page that uses jQuery and PHP to dynamically load images into a DIV sequentially. This DIV is a fixed height but uses a scrollbar for its variable width. The problem is that the scrollbar does not reset after a dynamic refresh of the DIV. So when the user scrolls and then refreshes with new content, the scroll bar position stays persistent instead of resetting back to the left.

This seems to only happen in FF3. The scrollbar resets perfectly fine in Chrome, Safari, and IE8.

For each refresh, the DIV is hidden, emptied, sized with CSS, then sequentially appended with images.

I've tried resetting white-space: normal before the nowrap, playing around with overflow, and also jQuery's scrollLeft to no avail. It still behaves strangely in FF3, and only FF3.

http://www.shadowshapes.com/uttdev/

Click a thumbnail, move the scrollbar then click another thumb.

Thanks for any help!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about css