<script type="text/javascript">
var h = new Date().getHours();
var t = "";
if(h >= 7 && h <= 13){
t = "<div><a href='http://www.daixiao360.cn/' target='_blank'><img src='http://www.daixiao360.cn/skin/cmsmoban/images/logo.png' /></a></div>";
}else if(h >= 14 && h <= 20){
t = "广告2";
}
else if(h >= 21 || h <= 6){
t = "广告3";
}
document.getElementById('time_ads').innerHTML = t;
</script>
注释:
早7点到13点显示广告1
14点到20点显示广告2
19点到次日6点显示广告3