We have learnt how to make a rolling call board in the last article. Following the last article, we will learn how to make the picture freely moving in the web page. It is very common in the web page. For example, the web site often places the most important information in the free-moving picture, which usually has a link to the detail information. What we are interested in is the free-moving picture. How can it be achieved? After studying this article carefully, you will learn about the ways to achieve it. OK, let us start.
First, open the web page you have saved in the past. The original web page is like this
Second, put the following blue text into the section of <body> and </body>.
Now let us learn about these codes. <a href> is to set the link address of the image. <img src> is to set the source of the image. You can change them according to your case. The <var.> is to set the position of the image. And the function <changePos> is to build a function to control the change of the position. Further more, the sentence of <if …else..> is to definite the position in detail. The visibility of the image’s value is true. Pay attention the codes are put into the section between <body> and </body> because it just applies to one image.
Third, go back to the design view. Save the document and preview it in the Internet Explorer. The effect is like the following image. You can see the image is moving. A little angel is flying.
Finally, the free-moving picture is ready. In fact it is a little difficult. If you practice it regularly, you will mater it.