|
@@ -27,8 +27,13 @@ const draggable = {
|
|
} else if (y > maxY) {
|
|
} else if (y > maxY) {
|
|
y = maxY
|
|
y = maxY
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ let wrap = document.getElementsByClassName('app-main draggable-box')[0]
|
|
|
|
+ if(x>wrap.offsetWidth-35){
|
|
|
|
+ x = wrap.offsetWidth-35
|
|
|
|
+ }
|
|
el.style.left = x + 'px'
|
|
el.style.left = x + 'px'
|
|
|
|
+
|
|
|
|
+ console.log(x,'新坐标',el)
|
|
el.style.top = y + 'px'
|
|
el.style.top = y + 'px'
|
|
lastTime = new Date().getTime();
|
|
lastTime = new Date().getTime();
|
|
if( (lastTime - firstTime) < 200){
|
|
if( (lastTime - firstTime) < 200){
|