首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Owl Carousel -单击下一步的图像

问Owl Carousel -单击下一步的图像
EN

Stack Overflow用户
提问于 2017-01-27 21:15:13
回答 1查看 3.1K关注 0票数 0

我有一个猫头鹰旋转木马,当我点击图像时想要转到下一个图像。没有箭头或分页等。

我没有太多使用猫头鹰旋转木马的经验。

这就是我的HTML中的内容。我将touchDrag设置为true,但是我希望在图像上单击以前进到下一个图像。

代码语言:javascript
复制
$(document).ready(function(){
    "use strict";
    //Carousel
    $(".carousel").owlCarousel({
        items : 1,
        autoPlay: true, 
        touchDrag  : true,
        mouseDrag  : true,    
        singleItem:true,
        responsive:true,
        autoHeight : true,
        transitionStyle:"fade"

    });
});
EN

回答 1

Stack Overflow用户

发布于 2017-01-27 21:21:21

您可以将单击处理程序附加到轮播幻灯片本身,从而将其移动到下一张幻灯片上。

代码语言:javascript
复制
$(document).ready(function(){
  //Carousel
  var owl = $(".carousel").owlCarousel({
    items : 1,
    autoPlay: true, 
    touchDrag  : true,
    mouseDrag  : true,    
    singleItem:true,
    responsive:true,
    autoHeight : true,
    transitionStyle:"fade"
  });

  $('.owl-item').click(function() {
    owl.trigger('next.owl.carousel');
  })
});
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41894838

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档