JS实现简单的顶部定时关闭层效果
<scripttype="text/javascript">
vartime=300;
varh=0;
functionaddCount()
{
if(time>0)
{
time--;
h=h+5;
}
else
{
return;
}
if(h>300)//高度
{
return;
}
document.getElementById("ads").style.display="";
document.getElementById("ads").style.height=h+"px";
setTimeout("addCount()",30);
}
window.onload=functionshowAds()
{
addCount();
setTimeout("noneAds()",7000);//停留时间自己调了
}
varT=300;
varN=300;//高度
functionnoneAds()
{
if(T>0)
{
T--;
N=N-5;
}
else
{
return;
}
if(N<0)
{
document.getElementById("ads").style.display="none";
return;
}
document.getElementById("ads").style.height=N+"px";
setTimeout("noneAds()",30);
}
</script>
<divstyle="MARGIN:0pxauto;WIDTH:900px;BACKGROUND:#369;HEIGHT:300px;COLOR:#fff"id="ads">毛票票_www.nhooo.com</div>
热门推荐
10 五一公司放假祝福语简短
11 追星女孩的祝福语简短
12 给长辈端午祝福语 简短
13 生日祝福语有诗意简短
14 团圆日祝福语简短
15 中秋商务祝福语简短最新
16 温暖文艺简短祝福语短句
17 男孩上学祝福语简短的
18 入住酒店文案祝福语简短