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 祝福语驱散霉运的话简短