When a web page consists of a lot of content, which sometimes may have ten or more pages long, you will feel bored and have no patience to go on readying. So, how can we solve this problem in making website? Yeah, like the past problems, it needs the help of HTML codes. We can avoid the bother for our views by making the web page roll automatically. You just need to memorize some codes about it and you can make the special effects easily. Now, let us learn how to achieve this effect by using HTML codes. Follow me step by step.
Step1
Open the web page which you want to roll automatically. The original web page is like this:
Step2
Set focus on the page; put the following codes into the section between <head> and </head> in the code view. But attention please, you need to take care when inputting the codes. When the codes apply to all the web page, you’d better insert them between <head> sentence.
- <script language="JavaScript">
- < !–
- locate = 0;
- function scroller() {
- if (locate !=460 ) {
- locate++;
- scroll(0,locate);
- clearTimeout(timer);
- var timer = setTimeout("scroller()",5);
- timer;
- }
- }
- // –>
- </script>
function scroller() is used to definite a scroller function. “460” in “if (locate!=460)” is the length of the showing page. You can change it to other number. var timer is to set the speed of the rolling page. Here we set it as 5 milliseconds.
Step3
Open the spilt view. We need to modify the <body> sentence like the following picture showing
It means that when we open the web page, it will carry out the onLoad event and roll automatically.
Step4
Back to the design view. Save it and preview in the internet explorer. The effect is like the following picture showing
In the static picture the effect cannot be expressed totally. But you can see the scroller have moved.
OK. we have mastered the way to make the web page roll automatically. Just some codes about <head> and <body> can help us achieve these special effects.

