机车滚动和jquery之间的冲突

Conflict between locomotive scroll and jquery

提问人:Jamaal 提问时间:11/17/2023 最后编辑:Jamaal 更新时间:11/17/2023 访问量:12

问:

我有几个代码与机车滚动冲突。

初始化机车时,swiperjs 和 back-to-top 功能不起作用。

我还更改了调用脚本的顺序,但没有运气。

有什么想法吗?

  const moreItems = new Swiper('.swiper', {
  //loop: true,
........
    320: {
    slidesPerView: 1.3,
    creativeEffect: {
      prev: {
        shadow: false,
        translate: ["-140%", 0, -700],
      },
      next: {
        shadow: false,
        translate: ["146%", 0, -700],
      },
.......
});

$(document).ready(function(){"use strict";  
        
        .........
            var height = $(document).height() - $(window).height();
            var progress = pathLength - (scroll * pathLength / height);
            progressPath.style.strokeDashoffset = progress;
        }
        .......
            if (jQuery(this).scrollTop() > offset) {
                jQuery('.progress-wrap').addClass('active-progress');
            } else {
                jQuery('.progress-wrap').removeClass('active-progress');
            }
        });             
        ..........
        
        
});

const scroll = new LocomotiveScroll({
  el: document.querySelector('.scroll-smooth'),
  smooth: true
});
jQuery swiper.js 机车涡旋

评论


答: 暂无答案