Effect.ScrollTo

Combination Effects > Effect.ScrollTo

Scrolls to a specific place in the page.

Examples


Effect.ScrollTo( 'li:eq(15)', 1000, {axis:'x'} ); // hmm, is this right?
Effect.ScrollTo('element_id', { duration:'0.2', offset:-20 }); // works in v1.8.2

Options

Option Description
duration float value, in seconds, defaults to 1.0
offset integer value, vertical offset of the target element, in pixels, defaults to 0

Notes

The offset option must be a numeric value in your code, i.e. not in quotes.

Demo

Click me to scroll to the top of the article

Source code of this demo


<a href="#" onclick="Effect.ScrollTo('article_top'); return false;">Click me to scroll to the top of the article</a>