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

remembering div position

P: n/a
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

Sep 19 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

st*************@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 <divto 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.

Sep 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.