Js ultra-beautiful advertisement code

Source: Internet
Author: User
Tip: you can modify some code before running

Js ultra-beautiful advertisement code<html><body><div id="f_ad" > <input type="button" value="×" title="关闭窗口"; onclick="ad_t2=ad_t2+ad_t3"></input></div><script>var ad_w=300;var ad_h=250;var ad_l=(document.body.clientWidth-ad_w)/2;var ad_t=(document.body.clientHeight-ad_h)/2;var ad_ft=1; //过渡时间var ad_step=50;var ad_time=10;var ad_t1=ad_ft*1000/ad_step;var ad_t2=60;var ad_t3=(ad_w-ad_t2)*ad_time/ad_ft+ad_w;var ad_t4=0;var ad_t5=ad_time;var ad_t6=ad_t2;function flashad(){ if(ad_l<0||ad_t<0){ad_t2+=ad_t3;} if(ad_t2>=ad_t3){ ad_t5=0; if(ad_t4>ad_t6){ad_t4-=(ad_w-ad_t6)/ad_t1;} else{clearTimeout(ad_timer); f_ad.style.display="none"; return;} } if(ad_t2<=ad_w){ad_t4=ad_t2;ad_t5=ad_time;} if(ad_t2>ad_w&&ad_t2<ad_t3){ad_t5=Math.floor(ad_time-(ad_t2-ad_w)/(ad_w-ad_t6)*ad_ft);} ad_t2+=(ad_w-ad_t6)/ad_t1; f_ad.style.width=ad_t4; f_ad.style.height=(ad_t6*ad_h/ad_w)+(ad_t4-ad_t6)*(ad_h-ad_t6*ad_h/ad_w)/(ad_w-ad_t6); f_ad.style.left=(ad_t4-ad_t6)*ad_l/(ad_w-ad_t6)+document.body.scrollLeft; f_ad.style.top=(ad_t4-ad_t6)*ad_t/(ad_w-ad_t6)+document.body.scrollTop; ad_lt.style.width=ad_t4-28; ad_lt.innerText=ad_t5+"秒后自动关闭"; var ad_timer=setTimeout("flashad()",ad_step);}flashad();</script></body></html>This code is provided by the webpage special effect network.
Tip: you can modify some code before running

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.