用div + js能实现的
按纽触发事件来改变div属性

解决方案 »

  1.   

    用div+css+js能实现的
    js事件控制div的css
      

  2.   

    帮你写了一点,你看一下:
    <html>
    <head>
    <title>读取网页</title>
    </script>
    <script type="text/javascript">
    var msgObj=null;
    function showLayer(obj,x,y) {
        msgObj=document.createElement("div");//消息层
            msgObj.setAttribute("id","msgDiv");
            msgObj.setAttribute("align","center");
            msgObj.style.background="white";
            msgObj.style.border="1px solid #09f";
            msgObj.style.position="absolute";
            msgObj.style.left=x;
            msgObj.style.top=y;
            msgObj.style.font="12px Verdana,Geneva,Arial";
            msgObj.style.width="300px";
            msgObj.style.height="200px";
            msgObj.style.textAlign="center";
            msgObj.style.lineHeight="25px";
            msgObj.style.zIndex="10001";
            document.body.appendChild(msgObj);
    }
    function getPos(el,sProp) { 
            var iPos = 0;
            while (el!=null) {
                iPos+=el["offset" + sProp];
                el = el.offsetParent;
            }
            return iPos;
        }
        function removelayer() {//当点击页面时隐藏层
            if(event.srcElement.id!="button1" && msgObj!=null) {//判断事件源对象是不是显示层的按钮
                document.body.removeChild(msgObj);
                msgObj=null;
            }
        }
    </script>
    </head>
    <body onclick="removelayer()">
    <input type="button" id="button1" onclick="showLayer(this,getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight)" value="层一" />
    </body>
    </html>你的意思不是很明白,什么叫对应的层不一样,把第一个参数传不同的值应该可以吧,或者你只能自己多写几个方法了