Slick - 如何使用悬停暂停?;;

问题描述 投票:0回答:4
javascript html angularjs slick.js
4个回答
24
投票

用户

pauseOnHover:false
灵活的配置

例如:

$('.slider-nav').slick({
  slidesToShow: 3,
  slidesToScroll: 1,
  asNavFor: '.slider-for',
  dots: true,
  centerMode: true,
  focusOnSelect: true,
  pauseOnHover:false
});

6
投票
使用属性表示法时,

pauseOnHover
应写为
pause-on-hover

<slick pause-on-hover="false" ...>
    ...
</slick>

0
投票
 $('.slideshow').slick({
      幻灯片显示:1,
      幻灯片滚动:1,
      自动播放:正确,
      自动播放速度:2000,
      悬停暂停:假,
      暂停焦点:假,
    });


-1
投票

 jQuery(document).ready(function(){
    jQuery('.slick-slider').slick({
      slidesToShow: 3,
      slidesToScroll: 1,
      autoplay: true,
      autoplaySpeed: 0,
      speed: 3000,
      pauseOnHover: true,
      cssEase: 'linear'
      });
    });  
body {
  align-items: center;
  background: #000;
  color: #fff;
  display: flex;
  height: 100vh;
  flex-direction: column;
  font-family: sans-serif;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

h3 {
  background: #FFF;
  color: #000;
  font-size: 136px;
  line-height: 200px;
  margin: 10px;
  padding: 2%;
  position: relative;
  text-align: center;
}

.slick-slider {
  margin: auto;
  width: 90%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" rel="stylesheet"/>
<script
      src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
     <script
      src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
<ul class="slick-slider">
  <li><h3>1</h3></li>
  <li><h3>2</h3></li>
  <li><h3>3</h3></li> 
  <li><h3>4</h3></li> 
  <li><h3>5</h3></li> 
</ul>

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