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 生日广州男生祝福语简短