JS拖动效果 <!-- function DragPanel(Panel,event) { var delayX=event.clientX-parseInt(Panel.style.left); var delayY=event.clientY-parseInt(Panel.style.top); document.attachEvent("onmousemove",HandleMove); document.attachEvent("onmouseup",HandleUp); event.cancelBubble=true; event.returnValue=false; function HandleMove(e) { e=window.event; Panel.style.left=event.clientX-delayX+"px"; Panel.style.top=event.clientY-delayY+"px"; event.cancelBubble=true; } function HandleUp() { document.detachEvent("onmousemove",HandleMove); document.detachEvent("onmouseup",HandleUp); } event.cancelBubble=true; } // --> Drag Me [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]