实例代码一见: 复代码一见: <머리> <br>#main div{position:absolute;width:220px;height:150px;border:1px solid #999;} <br> <br>var a; <br>document.onmouseup = function() { <br>if (!a) return; <br>a = ""; <br>}; <br>document.onmousemove = function(d) { <br>if (!a) return; <br>d=d||이벤트; <br>a.style.left = (d.clientX - b) "px"; <br>a.style.top = (d.clientY - c) "px"; <br>}; <br>함수 $(o, e) { <br>a = o; <br>b = e.clientX - parsInt(a.style.left); <br>c = e.clientY - parsInt(a.style.top); <br>} <br> <본문> 1 2 3 4 5 6