Reply to Re: CSS Scroll Position After Javascript "reload()"

Your name:

Reply:


Posted by Ben C on 10/27/06 07:00

On 2006-10-27, Raffi <thegrizzzly@yahoo.com> wrote:
> Hi,
>
> I have an application screen with a CSS scroll area. Users click links
> in the scroll area which open small popup windows to enter data. When
> the data is submitted, the popup reloads the opener to update the page
> and closes itself. However when the parent page is updated, the div
> scrolls back to the top. Is there a way to have CSS remember the
> vertical scroll position and go back to it when the page is reloaded?
> Similar to document.body.scrollTop in Javascript.

I don't think there is a CSS-only way.

You can do this with fragment urls if it's the main document we're
scrolling. If somewhere near the link they clicked you put

<a name="foo"></a>

And then have the popup reload the page using url#foo. They won't be
exactly where they were, but somewhere near it. Might not work in all
browsers.

But in your case, we're talking about a div with overflow: scroll. You
can experiment with fragments, I don't know if that will work.

Can you even get the scroll offset with JS for elements other than body?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация