Click here to get back home

remembering div position

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
remembering div position stefano.troiani@gmail.com 09-19-2006
Posted by stefano.troiani@gmail.com on September 19, 2006, 8:50 am
Please log in for more thread options


Hi,

I have a left div where there the menu is, and it is quite long, longer
than the web page, so it has a scroll bar.
My question is, is there a way to remember the div position once
clicked in one link below the screen and the page has been recharged?
I would like to avoid the users to scroll that div over and over and
should be nice if it presents the same position it had before clicked.

Thanks a lot,

stefano


Posted by Andy Dingley on September 19, 2006, 9:29 am
Please log in for more thread options



stefano.troiani@gmail.com wrote:

> My question is, is there a way to remember the div position once
> clicked in one link below the screen and the page has been recharged?

Yes, but it's tricky and involves JavaScript.

Only URLs (bookmarks etc.) are "memorable" (I'm ignoring <form>s for
the moment) Position of user controls isn't memorable.

Your solution is to use JavaScript hooked to the scrolling events of
the <div> to then create a modified URL. Don't take too long doing it,
and don't do it too often, or else it will be unresponsive. Shortly
after scrolling has finished is fine.

Look at google maps for an example, although their "scrolling" is more
complex and they require a manual action to generate the bookmark.


Similar ThreadsPosted
non-remembering fields November 8, 2007, 1:29 pm
April 16, 2008, 2:52 am
placed in unexpected position August 18, 2008, 1:09 am
IE does not display/position June 14, 2005, 7:58 pm
Trying to position table columns December 28, 2005, 9:43 am
negative vertical position? December 20, 2006, 3:09 pm
Table position not working on Mozilla? August 17, 2004, 9:32 pm
HREF that instructs browser to position doc at END of doc January 20, 2005, 2:34 pm
position:fixed slows Mozilla March 9, 2005, 5:53 pm
HTML table position text injector? March 17, 2005, 8:02 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap