Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用Anosile在手机上滑动jQuery_Javascript_Jquery_Jquery Mobile - Fatal编程技术网

Javascript 使用Anosile在手机上滑动jQuery

Javascript 使用Anosile在手机上滑动jQuery,javascript,jquery,jquery-mobile,Javascript,Jquery,Jquery Mobile,如何在手机上滑动幻灯片 我正在使用幻灯片: 这是触发滑块“下一个”和“上一个”的代码: $('.carousel ul').anoSlide( { items: 1, speed: 500, prev: 'a.prev', next: 'a.next', lazy: true, auto: 4000 }) 在向左或向右滑动时是否可能触发下一个、上一个按钮 到目前为止,我有这个,但它不起作用: $('.carousel-contentList').

如何在手机上滑动幻灯片

我正在使用幻灯片:

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

$('.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});
});

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

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

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