Answer the question
In order to leave comments, you need to log in
Slide centering mode for Slick Slider?
Friends, can you throw ready HTML / CSS / JS code for Slick Slider with single slide centering mode?
I can't find the complete code. That is, HTML / CSS, but no JS, that is, JS, but no CSS, then something else is missing.
For example, here such a slider is shown, and there is even a js code, but there is nothing else. And if I can pull out the HTML, then the CSS doesn't work.
I'm new to this stuff, so it's hard to figure it out myself. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
What animation? Scrolling or what?
window.scrollTo({
top: 1000,
behavior: 'smooth'
});
This is called anchor links, there are many ways to implement this on the net) choose the one that best suits your task.
Download
or connect from CDN
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.css"/>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<div class="my-slider">
<div class="item-slide">SLIDE 1</div>
<div class="item-slide">SLIDE 2</div>
<div class="item-slide">SLIDE 2</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.my-slider').slick({
centerMode: true,
centerPadding: '60px',
slidesToShow: 3,
autoplay: true,
autoplaySpeed: 2000,
});
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question