I'm using slick to create a carousel from list items The structure of list is like this
<div class="slicker">
<li>
<img />
</li>
<li>
<img />
</li>
<li>
<img />
</li>
</div>
I'm unable to create a carousel of it . The content rather appears as a normal list. When checking the node I see the relevant classed added to the dom.
Link for slick :https://kenwheeler.github.io/slick/
The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators. Official documentation.
Setting up the project React Slick is the main library that provides us with the carousel component. slick-carousel provides styling for this component while react-icons will be used for importing icons. All styling for this application is located in src/index. css available in the source code.
Actually, Slick use div element as slide by default, but you can change it with the "slide" parameter (slide | element | 'div' | Element query to use as slide).
In your case you need to have (in your js) something like:
$('.slicker').slick({
slide: 'li'
});
You can also change your code with 'div' like "v2solutions.com" said but this change your semantics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With