简体   繁体   English

我漂亮的 slider 旋转木马有一个额外的白色幻灯片。 有什么办法可以摆脱它?

[英]My slick slider carousel has an extra white slide. Is there any way to get rid of it?

So basically Im using a slick slider and its working fine, however after it gets done sliding through all my images it slides to a blank white background and then resets the slider. Is there any way I can get the slider to reset back to the first slide after it finishes?所以基本上我使用的是光滑的 slider,它工作正常,但是在它完成我所有图像的滑动后,它会滑动到空白的白色背景,然后重置 slider。有什么办法可以让 slider 重置回第一个完成后滑动?

Here is the html that I am using:这是我正在使用的 html:

<section id="home-slider">
<div class="row" style="position: relative;">

  <div class="slider responsive single-item" style="margin-bottom: 0;">
     <div><img src="http://placehold.it/1920x455"/></div>
     <div><img src="http://placehold.it/1920x455"/></div>
     <div><img src="http://placehold.it/1920x455"/></div>
     <div><img src="http://placehold.it/1920x455"/></div>
  </div>

</div>
</section>

And I am also using foundation zurb which is why theres a row class. Here is my javascript to control my slider:我也在使用 foundation zurb,这就是为什么有一排 class。这是我的 javascript 来控制我的 slider:

 $(document).ready(function(){
      $('.single-item').slick({
        autoplay: true,
        arrows: false,
        pauseOnHover: false,
        draggable: false,
        mobileFirst: true
      });
    });

Any and all answers are appreciated.任何和所有的答案表示赞赏。 Thank you!谢谢你!

$(document).ready(function(){
      $('.single-item').slick({
        autoplay: true,
        arrows: false,
        pauseOnHover: false,
        draggable: false,
        mobileFirst: true
      });

Add the infinite: false property to slider when you initialize it. 初始化时,将infinite: false属性添加到滑块。

 $(document).ready(function(){
    $('.single-item').slick({
        autoplay: true,
        arrows: false,
        pauseOnHover: false,
        draggable: false,
        mobileFirst: true,
        infinite: false
    });
 });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM