摘要:
第一种原生js写法window.onload=function (){ var oDrag=document.getElementById('drag'); oDrag.onmousedown=function (ev) { var oEvent=ev||event; var disX=oEvent.clientX-oDrag.offsetLeft;//x坐标 var disY=oEvent.clientY-oDrag.offsetTop;//y坐标 document.onmousemove=function (ev) { var oEvent=ev||event; v... 阅读全文