<div class="slider-btns">
<div class="slide-go" onclick="slideGo(0)">
Перейти к слайду 0
</div>
<div class="slide-go" onclick="slideGo(1)">
Перейти к слайду 1
</div>
<div class="slide-go" onclick="slideGo(2)">
Перейти к слайду 2
</div>
<div class="slide-go" onclick="slideGo(3)">
Перейти к слайду 3
</div>
<div class="slide-go" onclick="slideGo(4)">
Перейти к слайду 4
</div>
</div>
<div class="slider">
<div>
<div class="slide">
0
</div>
</div>
<div>
<div class="slide">
1
</div>
</div>
<div>
<div class="slide">
2
</div>
</div>
<div>
<div class="slide">
3
</div>
</div>
<div>
<div class="slide">
4
</div>
</div>
</div>
body {
background-color: #ccc;
}
.slider {
position: relative;
max-width: 90%;
margin: 0 auto;
}
.slide {
font-size: 60px;
font-weight: bold;
text-align: center;
height: 200px;
line-height: 200px;
transition: .3s all;
}
.slick-center .slide {
box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.28) inset;
}
.slider-btns {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 20px;
}
.slide-go {
background-color: #fff;
box-sizing: border-box;
padding: 5px 10px;
margin: 10px;
cursor: pointer;
}
$('.slider').slick({
dots: false,
arrows: true,
speed: 600,
slidesToShow: 3,
autoplay: false,
infinite: false,
centerMode: true,
centerPadding: '0px',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 3,
}
},
{
breakpoint: 1000,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 700,
settings: {
slidesToShow: 1,
}
}
]
});
function slideGo(n) {
$('.slider').slick('slickGoTo', n);
}