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 给外婆敬酒祝福语简短