IE下测试通过FF提示:Non-standard document.all property was used. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
1.htm (line 9)

解决方案 »

  1.   

    <html> 
    <head> 
    <title>层的隐藏和显示</title> 
    <Script Language="JavaScript"> 
    function toV_H(divName, showStyle) 

    document.getElementById(divName).style.display=showStyle;

    </Script> 
    </head> <body> 
    <a href="javascript:toV_H('layer1','block')">显示层</a> 
    <div id="layer1" style="position:absolute; width:100px; height:150px; left:200px; top:300px; z-index:1; display:none;"> 
    <table width="200" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFF00" bordercolor="FF00FF"> 
    <tr> 
    <td> 
    11111111111111<br> 
    <a href="javascript:toV_H('layer1','none')">隐藏此层</a> 
    </td> 
    </tr> 
    </table> 
    </div> 
    </body> 
    </html>这样多好
    还有就是visibility这个样式的hidden以后,对象原来的位置还是被保留的,不如用display的none来得彻底啊