JavaScript: A simple method to implement floating advertisements on Web pages _ javascript skills

Source: Internet
Author: User
JavaScript is a simple way to implement floating advertisements on Web pages. If you need it, you can refer to the Web roaming. You will find that the Internet is not only the ocean of information, but also the ocean of advertising. In addition to common Gif Banner and Flash, floating advertisements are also one of the most popular online advertisements. When you drag the browser's scroll bar, the advertisement floating on the page can move along with the screen. Although this effect is of great practical value for advertisement display, for those who browse your webpage, this is something that hinders reading and affects reading interests. Therefore, it must not be abused. However, if you can make good use of it, it can play a significant role.


It is not difficult to make a floating advertisement. If you have a JS foundation, you can write one by yourself. If you are too lazy to write one, download a special effect tool from the Internet, paste the code as prompted. However, to really understand how it is made, you need to master some JS knowledge. Here we will introduce a simple floating advertisement practice.

The following code can be found inAnd I added some comments (I .e., the text after "//" and" Text ).

The Code is as follows:


  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.