为什么我的onmouseup不起作用的?
<script type="text/javascript">
window.onload=Drag;
function Drag(){
var oDrag=document.getElementById('one'),
w=document.getElementById('w');
document.onmousedown=fnDown;
}
function fnDown(event){
var oDrag=document.getElementById('one'),
disX=event.clientX-oDrag.offsetLeft,
disY=event.clientY-oDrag.offsetTop;
document.onmousemove=function(event){
event=event||window.event;
fnMove(event,disX,disY);
}
document.onmouseup=function(){
document.onmousedown=null;
document.onmouseup=null;
}
}
function fnMove(event,disX,disY){
var oDrag=document.getElementById('one'),
l=event.clientX-disX,
t=event.clientY-disY;
oDrag.style.left=l+'px';
oDrag.style.top=t+'px';
}
</script>