jQuery猫头鹰Carousel 2隐藏导航 [英] jQuery Owl Carousel 2 hide navigation

查看:570
本文介绍了jQuery猫头鹰Carousel 2隐藏导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用'Owl Carousel 2'建立一个漂亮的内容滑块,只有当只有一个或多个项目可见时,才可以隐藏nav按钮。

I am building a nice content slider with the 'Owl Carousel 2' only is it possible to hide the nav buttons when there is only one or times items visible?


like:如果只有一个项目或两个项目可见,它们会在div.item上附加第二个CSS类别。当有一个项目:classitem one,当有两个框:class =item two当有多于2时,那么它将只有class =item。

like: when there is one item: class"item one" and when there are two boxes: class="item two" when there are more then 2 then it's will be only class="item".

JS:

jQuery("#sliderwhat").owlCarousel({
    loop : true,
    nav : true
});

HTML:

<div id="sliderwhat" class="box">

    <div class="item">
        <img src="image.jpg" alt="" />
        <span>Personal guide / <span>Amsterdam</span></span>
        <div>Here some text bla bla bla.</div>
    </div>

</div>


推荐答案

尝试此操作。

jQuery("#sliderwhat").owlCarousel({

        navigation : false, // Show next and prev buttons
        slideSpeed : 300,
        paginationSpeed : 400,
        singleItem:true

    });
  }

这篇关于jQuery猫头鹰Carousel 2隐藏导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆