gpt4 book ai didi

javascript - 当幻灯片总数和显示的幻灯片数量相等并且 slider 也不滑动时,光滑的 slider 箭头会隐藏

转载 作者:行者123 更新时间:2023-12-02 19:07:39 25 4
gpt4 key购买 nike

所以我尝试了很多方法。我想要实现的是我只有 3 张幻灯片,但也显示 3 张幻灯片。每当我输入 slidesToShow: 3 时, slider 就会停止工作并且箭头会隐藏。

我的代码如下。请帮忙。

$('.slider-for').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: false,
asNavFor: '.slider-nav',
initialSlide: 0,
});

$('.slider-nav').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: false,
focusOnSelect: true,
arrows: true,
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.0/slick.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.css" />

<div class="slider slider-for">
<div>
<div class="quote">
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore</h4>
</div>
</div>
<div>
<div class="quote">
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore</h4>
</div>
</div>
<div>
<div class="quote">
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore</h4>
</div>
</div>
</div>

<div class="slider slider-nav">
<div>
<div class="quote-image">
<img src="https://demo.plugins360.com/wp-content/uploads/2017/12/demo.png" alt="" width="200px">
</div>
</div>
<div>
<div class="quote-image">
<img src="https://demo.plugins360.com/wp-content/uploads/2017/12/demo.png" alt="" width="200px">
</div>
</div>
<div>
<div class="quote-image">
<img src="https://demo.plugins360.com/wp-content/uploads/2017/12/demo.png" alt="" width="200px">
</div>
</div>
</div>

最佳答案

设置幻灯片显示:2.99这就是我的答案

关于javascript - 当幻灯片总数和显示的幻灯片数量相等并且 slider 也不滑动时,光滑的 slider 箭头会隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64801247/

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