用户
pauseOnHover:false
灵活的配置
例如:
$('.slider-nav').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: true,
centerMode: true,
focusOnSelect: true,
pauseOnHover:false
});
pauseOnHover
应写为pause-on-hover
:
<slick pause-on-hover="false" ...>
...
</slick>
$('.slideshow').slick({ 幻灯片显示:1, 幻灯片滚动:1, 自动播放:正确, 自动播放速度:2000, 悬停暂停:假, 暂停焦点:假, });
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>