[url=#] <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一直没法解决,谁能帮我改改?
当第一次拖动层时,层的位置会偏离很远。
[b]呃。。。这涉及到一个style的问题。。。
[/b]在ie和firefox中,obj.style这个东西实际上只是取得元素中属性style中的值!
如下例,你会发现style块中的属性一个都取不到!
<style>
#test{width:100px;background-color:red;}
</style>
<script>
window.onload=function(){
var t=document.getElementById('test')
var ts=t.style;
t.innerHTML=
"t.style.width:"+ts.width+"<br />"+
"t.style.backgroundColor:"+ts.backgroundColor+"<br />"+
"t.style.color:"+ts.color+"<br />"+
"t.style.paddingLeft:"+ts.paddingLeft
}
</script>
<body>
<div id="test" style="color:yellow;padding-left:100px;">
</div>
</body>
看到了没?前两个style 为空,后两个才有值。
如果是ie,问题很好解决,只要把style改成currentStyle即可。
[b]IE Only[/b]
[url=http://www.1sucai.cn/article/5010_2.htm]2[/url][url=http://www.1sucai.cn/article/5010_2.htm]下一页[/url][url=http://www.1sucai.cn/article/5010_all.htm]阅读全文[/url]