Div Scroll Position
Sometimes when creating scrollboxes, you might want the scrollbar to maintain its position when the user navigates away from, then returns to the page.
For example, say you have a link halfway down the scrollbox. The user clicks on the link - which opens a different webpage - then the user clicks the "Back" button to continue reading the rest of the contents of the scrollbox. When this happens with a normal scrollbox, the scrollbar will be back at the top of the scrollbox. In other words, the user will need to scroll back down to see the link they clicked on previously. This could become annoying, especially if there are many links. The code on this page overcomes this problem.
First, here's an example of what I mean.
onload event handler is added to the
<div>'s scrollbar to the position that is held in the hidden form field (specified by using the
Here's an example of a page with more than one scrollbox. On that page, the code has been changed to cater for multiple scrollboxes.
And here's the code for that: