拖动:
dom.onmousedown = function(e) {
document.onmousemove = function(event) {
}
}
dom.onmouseup = function(e) {
document.onmousemove = null
}
拖动边界处理方案:
1、容器dom上绑定:mouseleave事件(mouseout不行)
2、判断鼠标位置是否在容器dom范围内
拖动后松开鼠标元素还是随着鼠标移动:
1、给拖动元素添加user-select:none,让元素不可复制