844682916@qq.co 发表于 2018-11-27 10:49:46


            var startScroll, touchStart, touchCurrent;
            mySwiper.slides.on('touchstart', function (e) {
                startScroll = this.scrollTop;
                touchStart = e.targetTouches.pageY;
            }, true);
            mySwiper.slides.on('touchmove', function (e) {
                touchCurrent = e.targetTouches.pageY;
                var touchesDiff = touchCurrent - touchStart;
                var slide = this;
                var onlyScrolling =
                  (slide.scrollHeight > slide.offsetHeight) &&
                  (
                  (touchesDiff < 0 && startScroll === 0) ||
                  (touchesDiff > 0 && startScroll === (slide.scrollHeight - slide.offsetHeight)) ||
                  (startScroll > 0 && startScroll < (slide.scrollHeight - slide.offsetHeight))
                  );
                if (onlyScrolling) {
                  e.stopPropagation();
                }
            }, true);

cxy2020918 发表于 2020-9-18 18:47:11

解决了吗楼主
页: 1 [2]
查看完整版本: 垂直滚动的swiper里面overflow-y:auto失效