setTimeout(function(){
 oDiv.style.display="none"
},5000)

解决方案 »

  1.   


    问题简单 赚点分先<body>
    <div id="a" style="width:500px; height:300px; position:absolute; background:#000000; left:0px; top:0px;"></div>
    </body>
    <script>
    var timer
    var obj=document.getElementById("a")
    var Opacity =100
    function disapper(){
    obj.style.filter = "Alpha(opacity="+Opacity+")";
    Opacity=Opacity-2
    if(Opacity!=0)
    {timer=setTimeout("disapper()",50)}
    else
    {clearTimeout(timer)
    obj.parentNode.removeChild(obj)
    }
    }
    function window.onload(){
    disapper()
    }
    </script>
      

  2.   

    效果:http://oldhouse.fdc.com.cn/oldhouse2008/html/index.htm代码:
    <!--强压开始-->
    <DIV align="center" id="hiddenLayer"> 
    <table width="776" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td><a href="http://shows.fdc.com.cn/manage/openad.asp?adtype=11&adid=2021" target="_blank"><img src="http://shows.fdc.com.cn/2008/9/200891218453839346.gif" width="950" height="320" border="0"></a></td>
      </tr>
    </table>
    </DIV>
    <script language=javascript>
    setTimeout("hidediv()",5000);
    function hidediv()
    {
    document.getElementById('hiddenLayer').style.display = "none";
    }
    </SCRIPT><!--强压结束-->