Possible to disable touch simulation for slides but not scrollbar (idangerous swiper)?

家住魔仙堡 提交于 2019-12-05 15:37:13

Here is solution for Swiper-3.3.1

simulateTouch:false

I found a way that, for now, I'm happy with.

In the idangerous swiper source (idangerous.swiper-2.1.js) I return false from the onTouchStart function (line 1120) so my code now resembles the following:

    function onTouchStart(event) {
    if (params.preventLinks) _this.allowLinks = true;
    //Exit if slider is already was touched

    return false;

    if (_this.isTouched || params.onlyExternal) {
        return false;
    }

This is non-invasive to the way the scrollbar prototype works too, so the scrollbar's touch events are left in-tact.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!