<title></title>
<head>
<script language="javascript" type="text/javascript">
function closediv()
{
document.getElementById("hidediv").style.visibility="hidden"
}
</script>
</head>
<body onload="setTimeout('closediv()',5000)">
<div id="hidediv" style="visibility:visible">ok</div>
</body>
</html>
五秒后关闭层。你试试改下
1.用js获取时间time = new Date()
hours = time.getHours()//获取时间的小时
2.用js控制块<div>的显示与隐藏
<div id="id1"></div>
注:把广告放在块标签里
time = new Date()
hours = time.getHours()//获取时间的小时
function deal()
{
if (hours>=19 || hours <=7)
{
div1.style.display = "block"
}
else
{
div1.style.display = "none"
}
}