zrj11
2017-09-05 14:30
function fndown(){
var oDrag = document.getElementById('loginPanel');
var bclientX = oDrag.offsetLeft;
var bclientY = oDrag.offsetTop;
var aclientX = event.clientX;
var aclientY = event.clientY;
document.onmousemove = function(event){
event = event || window.event;
oDrag.style.left = (event.clientX - aclientX + bclientX + 'px');
oDrag.style.top = (event.clientY - aclientY + bclientY + 'px');
}
}
没问题
DOM事件探秘
99546 学习 · 1197 问题
相似问题