gpt4 book ai didi

jQuery Owl Carousel 2 隐藏导航

转载 作者:行者123 更新时间:2023-12-01 00:42:16 26 4
gpt4 key购买 nike

我正在使用“Owl Carousel 2”构建一个不错的内容 slider ,但当只有一个或多个项目可见时,是否可以隐藏导航按钮?

当只有一个或两个项目可见时,它们会在 div.item 上附加第二个 CSS 类?

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 Owl Carousel 2 隐藏导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28342603/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com