when a link is at the bottom of the browser window and user click it to show some content, I would like the browser to scroll down so that the shown content is located at the top of the window to be visible. how to do this in jquery?
+1
A:
You can use plain javascript to do this.
Use scrolIntoView function.
rahul
2010-02-04 07:11:17
thanks. any idea on how to add a sliding effect when scroll?
perlwle
2010-02-04 08:00:13
You can use slideToggle.
rahul
2010-02-04 09:03:13
sorry if i wasn't clear. I meant that scrollIntoView goes to the position instantly. but I would like to create a sliding effect for the scrolling.
perlwle
2010-02-04 09:35:12
For that you can use the scrollto plugin suggested by @Jon, or use animate function in jquery.
rahul
2010-02-04 09:56:34