If you are in the bottom of the html page and if you want to go to the top of the page, You can use the following java script.
window.scrollBy(-document.body.clientWidth,-document.body.clientHeight);
Otherwise if you wanna goto top... yes you are right, remove the minuses.
If you want to scroll inside any dom elements, you can use this javascript method to determine the height or width of that element.
document.documentElement.clientHeight/Width
This entry was posted
on Jun 2, 2008
at Monday, June 02, 2008
and is filed under
javascript
. You can follow any responses to this entry through the
comments feed
.