<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script>
var ms=0; 
function did(obj)...{
ms=obj;
event.srcElement.setCapture();
x=document.all(ms).style.pixelLeft-event.x;
y=document.all(ms).style.pixelTop-event.y;
} 

function document.onmousemove()...{ 
if(ms)...{
document.getElementById(ms).style.pixelLeft=x+event.x;
document.getElementById(ms).style.pixelTop=y+event.y;
}
} 

function document.onmouseup()...{ 
if(ms)...{
//alert(ms);
event.srcElement.releaseCapture();
ms=0;
}
}
</script> 
<body>
<div id="a1" style="position:absolute;background-color:black; height:200px; width: 50px; ">
<div id="a2" onmousedown="did('a1')" style="background-color: #f2f2f2; height:100px; width:30px; cursor: move;">拖动层</div>
</div>
</body>
</html>

被折叠的 条评论
为什么被折叠?



