Explorar el Código

横版+号层位置调整

zhouna hace 3 años
padre
commit
82f998cafd
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      src/js/cdssHorizontal.js

+ 6 - 3
src/js/cdssHorizontal.js

@@ -664,7 +664,8 @@ function bindSlide() {
       longBox.css("display", "block")
     let location = longBox.attr("data-location")
     let scrollTop = getLongTop(location)
-      longBox.css("top", 3 + Number(scrollTop) + "px")
+      const n = -10 + Number(scrollTop)>-1?(-10 + Number(scrollTop)):0;
+      longBox.css("top", n + "px")
   })
   $(".showLess").off("click").on("click", function () {
     $(this).parent().parent().css("display", "none")
@@ -749,12 +750,14 @@ function addScrollEvent() {
   $(`.leftWrapper`).off("scroll").scroll(throttle(function () {
 
     if ($(".leftWrapper .longStrBox:visible").length) {
-      $(".leftWrapper .longStrBox:visible").css("top", Number(getLongTop("left")) + 3 + "px")
+        const n = Number(getLongTop("left")) -10>-1?(Number(getLongTop("left")) -10):0;
+      $(".leftWrapper .longStrBox:visible").css("top", Number(getLongTop("left")) -10 + "px")
     }
   }, 100));
   $(`.rightWrapper`).off("scroll").scroll(throttle(function () {
     if ($(".rightWrapper .longStrBox:visible").css("display") === "block") {
-      $(".rightWrapper .longStrBox:visible").css("top", Number(getLongTop("right")) + 3 + "px")
+      const n = Number(getLongTop("right"))>-1?(Number(getLongTop("right"))):0;
+      $(".rightWrapper .longStrBox:visible").css("top", n + "px")
     }
   }, 100));
 }