当前位置:网站首页 > 图文广告 > 正文

用js使广告窗口倒计时5秒后关闭

作者:admin发布时间:2021-07-03分类:图文广告浏览:评论:24


导读:!="en"="UTF-8"=""="=-,-scale=1.0"metahttp-equiv="X-UA-Compatible"content="ie=edge"titleDoc...

用js使广告窗口倒计时5秒后关闭

!="en"="UTF-8"=""="=-,-scale=1.0"metahttp-equiv="X-UA-Compatible"content="ie=edge"titleDocument/titlestyle

body,

html{

height:100%;}

div{

display:fixed;

left:0;

right:0;

top:0;

bottom:0;

margin:auto;

height:300px;

width:500px;

line-height:300px;

text-align:center;

background-color:#ccc;

margin-top:100px;}

divspan{

color:red;}/style/headbodydivid="ads"h1这是一则广告,在spanid="count5s"5/span秒后自动关闭!/h1/divscriptfunctioncloseAds(){

document.getElementById('ads').style.display="none";

}

varoCount5s=document.getElementById("count5s").innerText

varsecond=parseInt(oCount5s)

functioncountDown(){

second-=1;

document.getElementById("count5s").innerText=second;

}

varcountDown=setInterval(countDown,1000)

setInterval(function(){

if(second===0){

closeAds();

clearInterval(countDown);

}

},1000)

/script/body/html

标签:html手机广告倒计时弹屏6


已有24位网友发表了看法:

欢迎 发表评论: