Start scrolling html page
6 answers
You can use window.scrollBy () method:
http://www.mediacollege.com/internet/javascript/page/scroll.html
Or use the jQuery scrollTo plugin which gives you more flexibility.
0
a source to share
<html>
<head>
<script>
scroller = function() {
bodyHeight = Math.max(
Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
Math.max(document.body.clientHeight, document.documentElement.clientHeight)
);
scrollToPosition = Math.floor(bodyHeight / 100 * 60);
window.scrollTo(0, scrollToPosition);
}
</script>
</head>
<body onload="scroller()">
</body>
</html>
0
a source to share
Depending on what you want to display, you can add id selectors to your content and then skip the page using a url for example.
<div id="content">
<!--Content Goes Here -->
</div>
And open the page using:
http://www.mysite.com/mysite.html#content
Another example would be the following:
0
a source to share