实现原理
1.位置计算(相对视口)
1.获取鼠标点击坐标
2.获取元素的坐标
3.移动时鼠标位置
2.
window.onmouseup= function(){ console.log('不再监听移动') // moveBar.onmousedown=null window.onmousemove = null window.onmouseup = null
// moveBar.onmouseup =null }
window.onmouseup= function(){ console.log('不再监听移动') // moveBar.onmousedown=null window.onmousemove = null window.onmouseup = null // moveBar.onmouseup =null }
标签:便签,功能,null,moveBar,window,onmouseup,移动 From: https://www.cnblogs.com/shibiao9999/p/17790221.html