当没有要循环的项目时,jQuery owl2删除导航箭头

问题描述 投票:0回答:1

我有以下旋转木马

enter image description here

我想在左/右侧没有任何项目的情况下消失其中一个导航箭头。在上面的屏幕截图中,如果我尝试使用左箭头,它不会循环,因为左侧没有图像,所以箭头不应该出现。

以下是我目前正在使用的设置

Navigation.Defaults = {
    nav: false,
    navRewind: false,
    navText: [ 'prev', 'next' ],
    navSpeed: false,
    navElement: 'div',
    navContainer: false,
    navContainerClass: 'owl2-nav',
    navClass: [ 'owl2-prev', 'owl2-next' ],
    slideBy: 3,
    dotClass: 'owl2-dot',
    dotsClass: 'owl2-dots',
    dots: true,
    dotsEach: false,
    dotData: false,
    dotsSpeed: false,
    dotsContainer: false,
    controlsClass: 'owl2-controls',
    loop: false,
};
javascript jquery carousel owl-carousel
1个回答
-1
投票

尝试使用下面的CSS。

.owl-nav .owl-prev.disabled,
.owl-nav .owl-next.disabled {
   display: none !important;
}

或者你可以用这个答案jshttps://stackoverflow.com/a/28027976/9695286做到这一点

© www.soinside.com 2019 - 2024. All rights reserved.