How to scroll whole visible page down to an anchor with a smooth effect (Scriptaculous or jQuery)?
Posted
by ChrisBenyamin
on Stack Overflow
See other posts from Stack Overflow
or by ChrisBenyamin
Published on 2010-05-13T15:30:35Z
Indexed on
2010/05/13
15:34 UTC
Read the original article
Hit count: 184
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
© Stack Overflow or respective owner