dom.onmousedown = function (e) {
that.ismove = false
document.onmousemove = function (e) {
that.ismove = true
that.move(e) //拖动处理 比如重新定义位置
};
document.onmouseup = function () {
if(!that.ismove){
that.handler() // 是点击事件 处理点击事件
}
that.ismove = false
document.onmousemove = null;
document.onmouseup = null;
that.check() //可以检测移动的位置 控制定位
};
return false;
};
Drag and drop to move the dom
Guess you like
Origin blog.csdn.net/weixin_43392545/article/details/132452303
Ranking