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 送给学长毕业祝福语简短