I
I
igor_solweb2020-08-07 01:17:29
JavaScript
igor_solweb, 2020-08-07 01:17:29

How to enable slick slider only if slides > 1?

Good day/night!

I connected it to wordpress on the slick slider page, set it up, everything works fine. Made it for feedback.
The question is:
How to enable the slider only if there are more than 1 reviews? And, accordingly, turn off when the quantity = 1 pc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
godsplane, 2020-08-07
@igor_solweb

Probably something like this

$(document).ready(fucntion() {
var slidesCount = $('.slide-item').lenght
if(slidesCount > 1) {
   $('.slider-wrapper').slick();
} 
}}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question