为什么后几次有时候会出现bug,出现鼠禁止样式,松开鼠标也可以移动
$('.div').on('mousedown', function(e) { typeMouse = true; $(document).on('mousemove', function(e) { if(typeMouse) { var rotateX = e.pageX - type1Dot1X; var rotateY = e.pageY - type1Dot1Y; var rotate = Math.atan(rotateY/rotateX); type1Rotate = (rotate * 180 / Math.PI); console.log(type1Rotate); type1Conrol.css('transform', `rotateZ(${type1Rotate}deg)`); } }); }); $(document).on('mouseup', function(e) { typeMouse = false; });
橋本奈奈未
相关分类