jQuery 使用 anoSlide 在移动设备上滑动

jQuery swipe on mobile using anoSlide

如何在移动设备上滑动幻灯片?

我正在使用 anoSlide:http://www.anowave.com/factory/anoslide/demo.html

这是触发下一个和上一个滑块的代码:

$('.carousel ul').anoSlide(
{
    items: 1,
    speed: 500,
    prev: 'a.prev',
    next: 'a.next',
    lazy: true,
    auto: 4000
})

是否可以在向左或向右滑动时触发下一个、上一个按钮?

到目前为止我有这个但它不起作用:

$('.carousel-contentList').on("swiperight",function(){
    $(this).anoSlide({next: next});
});

$('.carousel-contentList').on("swipeleft",function(){
    $(this).anoSlide({prev: prev});
});

下一个和上一个属性用于关联 DOM 元素,如按钮。它们不是更改当前幻灯片的方法。您可以在滑动时触发上一个和下一个按钮的点击事件:

$('.carousel').on("swiperight",function(){
    $('a.prev').click();
});

$('.carousel').on("swipeleft",function(){
    $('a.next').click();
});

DEMO