Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

移动端 用了swiper和iscroll好像冲突 报错

 document.addEventListener('touchmove', function (e) {
        // 判断默认行为是否可以被禁用
        if (e.cancelable) {
            // 判断默认行为是否已经被禁用
            if (!e.defaultPrevented) {
                e.preventDefault();
            }
        }}, { passive: true } );
    var mySwiper = new Swiper('.swiper-container', {
        onlyExternal : true,
        onTransitionEnd: function (swiper) {
            $('#nav li').eq(mySwiper.activeIndex).addClass('active').siblings().removeClass('active');
        }
    });
    $('#nav li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        mySwiper.slideTo($(this).index(), 500)
    });

Unable to preventDefault inside passive event listener due to target being treated as passive.

clipboard.png

火狐里警告又是这样
indicate sourceMappingURL pragmas is deprecated.

clipboard.png

我看了网上的问题 解决方法都写了 但是都不好用 能有大神帮忙解决一下么 ><不胜感激


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

谢邀.

手动帮你搜了个答案。如果不影响功能实现的话,可以忽略掉;或者你可以按答案思路去插件的代码里搜搜是谁在捣鬼。

以上.


刚写完发现又多了个火狐的……你把插件里最后一行mapping文件去掉应该就可以了吧。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...