This isn't really an issue, but more of a question/help.
I want to initiate the carousel on multiple pages but want to keep my JS tidy.
I'd like to pass in the settings and element in to the slick initia
e.g:
jQuery(element).slick({settings array via variable});
I've tried the following settings array but it doesn't render the carousel. It actually "breaks" the gulp lint task I have running.
var settings = [
dots: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
lazyLoad: 'ondemand',
]
I've tried putting each setting in "quotes" etc and it doesn't work until I manually put the settings in as they're meant to be.
Is there something I'm missing here or is it not possible?
I've event tried doing "toString()" on the variable - didn't work.
Why not just use the object?
var settings = { dots: false, infinite: true, slidesToShow: 1, slidesToScroll: 1 }
jQuery(element).slick(settings);
Exactly what I needed. I couldn't get the correct syntax for the settings variable.
It's working exactly as I need it to now, thank you