layer 本身就不是标准和东东,现在的层都是使用样式表里的定位方式设置而成的。style="position: absolute"

解决方案 »

  1.   

    layer是netscape6.0以前的版本用的,6.0以后不用了。层统一用div
      

  2.   

    http://www.csdn.net/Develop/Read_Article.asp?Id=5361Netscape 6 支持的对象和属性列表
      

  3.   

    那么,谁能改改下面的网页和脚本,使它可以netscape上能有效运行。<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>div polit</title>
    <script language="JavaScript" >
    <!--
    function moveUp()
    {
    document.all.redBox.style.pixelTop+=(-20);
    }
    function moveDown()
    {
    document.all.redBox.style.pixelTop+=20;
    }
    function moveLeft()
    {
    document.all.redBox.style.pixelLeft+=(-20);
    }
    function moveRight()
    {
    document.all.redBox.style.pixelLeft+=20;
    }
    function showHide()
    {
    if(document.all.yellowBox.style.visibility=="hidden")
    document.all.yellowBox.style.visibility="visible";
    else
    document.all.yellowBox.style.visibility="hidden";
    }
    //-->
    </script>
    </head><body><div id="redBox" style="position:absolute; left:150px; top:150px; background-color:red">
    <form>
    <input type="button" value="UP" onClick="moveUp()" >
    <input type="button" value="DOWN" onClick="moveDown()">
    <input type="button" value="LEFT" onClick="moveLeft()">
    <input type="button" value="RIGHT" onClick="moveRight()">
    <input type="button" value="SHOW/HIDE Yellow Box" onClick="showHide()">
    </form>
    </div><div id="yellowBox" style="background-color:yellow">
    这里放一些文本
    </div>
    </body>
    </html>
      

  4.   

    那么,谁能改改下面的网页和脚本,使它可以netscape上能有效运行。<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>div polit</title>
    <script language="JavaScript" >
    <!--
    function moveUp()
    {
    document.all.redBox.style.pixelTop+=(-20);
    }
    function moveDown()
    {
    document.all.redBox.style.pixelTop+=20;
    }
    function moveLeft()
    {
    document.all.redBox.style.pixelLeft+=(-20);
    }
    function moveRight()
    {
    document.all.redBox.style.pixelLeft+=20;
    }
    function showHide()
    {
    if(document.all.yellowBox.style.visibility=="hidden")
    document.all.yellowBox.style.visibility="visible";
    else
    document.all.yellowBox.style.visibility="hidden";
    }
    //-->
    </script>
    </head><body><div id="redBox" style="position:absolute; left:150px; top:150px; background-color:red">
    <form>
    <input type="button" value="UP" onClick="moveUp()" >
    <input type="button" value="DOWN" onClick="moveDown()">
    <input type="button" value="LEFT" onClick="moveLeft()">
    <input type="button" value="RIGHT" onClick="moveRight()">
    <input type="button" value="SHOW/HIDE Yellow Box" onClick="showHide()">
    </form>
    </div><div id="yellowBox" style="background-color:yellow">
    这里放一些文本
    </div>
    </body>
    </html>