<script type="text/javascript"> |
| <!-- |
| var nowheight=0; //初始广告层高度 |
| var maxheight=354; //广告层最大高度 |
| var adobj; |
| var opendiv; |
| var closdiv; |
| var addfunc; |
| var handobj; |
| var reducefunc; |
| var speed=7; //层卷动速度 |
| function showtopad() { |
| adobj=document.getElementById("bigad"); |
| opendiv=document.getElementById("opendiv"); |
| closdiv=document.getElementById("closdiv"); |
| if (nowheight<=0) { |
| opendiv.style.display="none"; |
| adobj.style.display="block"; |
| addfunc=setInterval("addheight()",1); |
| } |
| } |
| function closetopad() { |
| if (nowheight>0) { |
| callreduceheight(); |
| if (typeof(handobj)=="number") { |
| clearTimeout(handobj); |
| } |
| } |
| } |
| function addheight() { |
| nowheight+=speed; |
| if (nowheight>maxheight) { |
| clearInterval(addfunc); |
| closdiv.style.top=maxheight-30; |
| closdiv.style.display="block"; |
| handobj=setTimeout("callreduceheight()",6000); |
| return; |
| } |
| adobj.style.height=nowheight+"px"; |
| } |
| function callreduceheight() { |
| closdiv.style.display="none"; |
| reducefunc=setInterval("reduceheight()",1); |
| } |
| function reduceheight() { |
| adobj.style.height=nowheight+"px"; |
| nowheight-=speed; |
| if (nowheight<=0) { |
| clearInterval(reducefunc); |
| adobj.style.display="none"; |
| opendiv.style.display="block"; |
| return; |
| } |
| } |
| //--> |
| </script> |
| <body onload="showtopad()"> |
| <div id="opendiv" style="position:absolute;top:3px;right:3px;z-index:10;padding:3px;border:1px #000 solid;display:none;cursor:hand;background:#fff;"><span onclick="showtopad()">重播</span></div> |
| <div id="closdiv" style="position:absolute;right:4px;z-index:10;padding:3px;border:1px #000 solid;display:none;cursor:hand;background:#fff;"><span onclick="closetopad()">关闭</span></div> |
| |
| <div id="bigad" style="width:960px;height:0;overflow:hidden;display:none;"> |
| <a target="_blank"> |
| <img src="http://www.wuwangwo.cc/images/ad/lamu/lamuda.gif"> |