Browse Source

🐛各种兼容问题

shaogen1995 1 năm trước cách đây
mục cha
commit
1135693a54
1 tập tin đã thay đổi với 13 bổ sung3 xóa
  1. 13 3
      src/components/PaintingDetailBox.vue

+ 13 - 3
src/components/PaintingDetailBox.vue

@@ -68,6 +68,11 @@ const mousemoveFu = (e, flag) => {
 
 let resizeObserver = null
 
+
+let baseFlag = true
+
+let timeccc = -1
+
 onMounted(() => {
   const element = document.querySelector('#myElement')
 
@@ -80,14 +85,17 @@ onMounted(() => {
       pageHeight.value = pageHeightWindow
 
       moveLoc.value = 0
-      setTimeout(() => {
+
+      clearTimeout(timeccc)
+
+      timeccc = setTimeout(() => {
         if (isRow.value === "竖") {
           const dom = document.querySelector(".imgBox")
           if (dom && ( dom.offsetHeight > pageHeightWindow)) {
             isMove.value = true
             imgWidth.value = dom.offsetWidth
             imgHeight.value = dom.offsetHeight
-          }
+          } else isMove.value = false
         } else {
           const leftBoxWidthDom = document.querySelector(".leftBxo")
           const leftBoxWidthDomWidth = leftBoxWidthDom.offsetWidth
@@ -99,7 +107,8 @@ onMounted(() => {
             imgHeight.value = dom.offsetHeight
           }
         }
-      }, 600)
+        baseFlag = false
+      }, baseFlag ? 600 : 30)
       clearInterval(tiemrr.value)
 
       if (zhouMove.value >= 100) return
@@ -351,6 +360,7 @@ onBeforeUnmount(() => {
       .smImgBoxMain {
         overflow: hidden;
         position: relative;
+        transition: all .3s;
         .smBoxBor {
           cursor: grab;
           position: absolute;