Create a fixed position to pop up the floating ad instance code

Source: Internet
Author: User

I haven't written the JS program for a long time. I am free these two days. I have rewritten the previous floating ad code. Well, we have limited capabilities in that sentence. If you have any mistakes, please give us your evidence and give us some advice. Demo Effect

Demo address: http://www.yaohaixiao.com/

The effect of the demo is to bring up a video advertisement. However, this video is a JAVASCRIPT tutorial, so it is not set to automatically close. Let's briefly introduce the features of the advertisement code:

1. Supports pop-up of video advertisements for images, FLASH, and FLV 2. Pop-up five seconds after the page is loaded (although the advertisement is always annoying), so that the user is a little better to the user. 3. you can set the auto-closing time for AD display (the default display time for images and FLASH is 10 seconds. you can set the ad space: RIGHT-bottom RIGHT corner, CENTER-browser visible area (viewport) CENTER, LEFT-bottom LEFT corner call is very convenient:

Attach image Advertisement
YAO. adBox. img ({
Src: 'http: // www.yaohaixiao.com/img/ad.jpg', // image path-required
Href: 'http: // www.yaohaixiao.com/', // URL of the advertisement-required
Title: 'My image ads', // the title of the AD window-optional
Position: 'center', // The position of the AD window-optional
Showtime: 15000 // display time of the advertisement-optional (currently, I am processing images and flash ads will be automatically disabled, and video ads can be set and displayed all the time)
})

Load FLASH ads
YAO. adBox. flash ({
Swf: 'http: // www.yaohaixiao.com/swf/ad.swf', // flash path-required
Title: 'My image ads', // the title of the AD window-optional
Position: 'center', // The position of the AD window-optional
Showtime: 15000 // 1000-1 second-optional
})

Load FLASH ads
YAO. adBox. flash ({
Playlist: 'http: // www.yaohaixiao.com/swf/ad.flv', // video path-required (js flvplayer also supports loading video lists in XML format)
Title: 'My image ads', // the title of the AD window-optional
Position: 'center', // The position of the AD window-optional
Showtime: 15000 // 1000-1 second-optional (if not written, it indicates that an advertisement is displayed, and the advertisement must be closed by the user. For example, for my JS teaching video, I think this video will always be displayed)
})

Slice:

  • Four pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • 4
  • Next Page

Related Article

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.