How to scroll whole visible page down to an anchor with a smooth effect (Scriptaculous or jQuery)?
- by ChrisBenyamin
Hey community,
I want to create an navigation with anchors. By clicking on a navigation link, the whole visible page should scroll down to the clicked anchor.
The most important is the following structure of the page.
--------------- (Begin visible browser area)
NAV1 nav2 nav3
content
--------------- (Begin/end visible browser area)
nav1 NAV2 nav3
content
--------------- (Begin/end visible browser area)
nav1 nav2 NAV3
content
--------------- (end visible browser area)
Finally all content is in a single document and the height of the current page (selected by the nav-item) has to be calculated (with a JS Library). I prefer PrototypeJS/Scriptaculous and jQuery.
The scroll effect should be a smooth slide/ effect.
Chris