asNavFor on click, not slide
-
I’d like my nav (#slick-slider-2) slider to change my for (#slick-slider-1) slider on click, and not slide when selected. I found that this can do it:
$(‘#slick-slider-1’).slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
accessibility: false
});$(‘#slick-slider-2’).slick({
slidesToShow: 5,
slidesToScroll: 1,
asNavFor: ‘#slick-slider-1’,
dots: false,
centerMode: false,
focusOnSelect: false
});$(‘#slick-slider-2 .slick-slide’).on(‘click’, function (event) {
$(‘#slick-slider-1’).slick(‘slickGoTo’, $(this).data(‘slickIndex’));
});Is there anyway to accomplish this directly in the plugin settings? If not, what is the best way to override/extend javascript with this plugin?
Here’s a js fiddle. You can click on the nav slides to see what I mean.
https://jsfiddle.net/m7bkn5ym/1/
- The topic ‘asNavFor on click, not slide’ is closed to new replies.