拖动层效果,兼容IE和FF!第1/2页

2019-06-03 15:09:50于丽

                    }
                }

                function up(){
                    dragok = false;
                    document.onmousemove = null;
                }

                document.onmousedown = down;
                document.onmouseup = up;

            }
        )();
    }
    -->
    </script>
</head>

<body>
<div id="main" class="dragclass">
    <div id="ChatHead">
        <a href="#" onclick="ChatHidden();">-</a>
        <a href="#" onclick="ChatShow();">+</a>
        <a href="#" onclick="ChatClose();">x</a>
    </div>
    <div id="ChatBody">
        <div id="ChatContent"></div>
        <div id="ChatBtn">
            <form action="" name="chat" method="post">
            <textarea name="ChatValue" rows="3" style="width:350px"></textarea>
            <input name="Submit" type="button" value="Chat" onclick="ChatSend(this.form);" />
            </form>
        </div>
    </div>
</div>

</body>
</html>

一个拖动效果,根据论坛的一些帖子改的,但还有一些BUG一直没法解决,谁能帮我改改?
当第一次拖动层时,层的位置会偏离很远。
呃。。。这涉及到一个style的问题。。。
在ie和firefox中,obj.style这个东西实际上只是取得元素中属性style中的值!