CarouFredSel Plugin using TouchSwipe with links not working

后端 未结 6 1163
梦谈多话
梦谈多话 2021-02-01 23:53

I\'m using the awesome CarouFredSel JQuery carousel plugin which includes features for integrating the JQuery TouchSwipe library for handheld devices as well.

The caro

6条回答
  •  Happy的楠姐
    2021-02-02 00:14

    Well, I'd really love to know if using links within TouchSwipe and the CarouFredSel plugin is possible, but I found a workaround that seems to work.

    Hopefully it will help someone.

    I ended up using a second touch jquery library, TouchWipe.

    When, calling the CarouFredSel plugin, I set the swipe parameter to true:

    $('#carousel-slider').carouFredSel({
            width: '100%',
            prev: '#prev-propslider',
            next: '#next-propslider',
            swipe: true
    });
    

    Then, calling both the TouchSwipe AND Touchwipe libaries (not sure if this matters, but I'm using the regular TouchSwipe swipe:true parameter for another slider without links), I wrote a separate function to call custom events for the TouchWipe plugin:

    $('#carousel-slider').touchwipe({
            wipeLeft: function() {
                $('#carousel-slider').trigger('next', 1);
            },
            wipeRight: function() {
                $('#carousel-slider').trigger('prev', 1);
            }
    });
    

    Hopefully this helps someone, but I'd really love to know if TouchSwipe and CarouFredSel can work with tags as I cannot find any live working examples.

提交回复
热议问题