I have a layout which has a slick slider, an image with the image icons on it, to go to a particular slides when clicked. The slick slider has 3 slides, which is working fine.
I have one thing to ask, how can I make the function as two way, as for now when I click on my external buttons, that button gets active and hence sides to the particular slider, but when I click on the slick dots, it doesn't add the active class to the button which I have.
I have used the slickGoTo method, but I'm wondering how can I achieve for this new thing, like when I click on 2nd number slick dots it should add an active class to the 2nd number image icon.
The code I have tried was to add the image icon to the slick init, before setting up, but didn't work out.
$('.box-one').on('init', function(event, slick){
var $items = slick.$dots.find('li');
$items.addClass('.img-logo');
});
This is the dummy div which works on the slick slider :
<div>
<div class='box-one'>
<div>1st DIV</div>
<div>2nd DIV</div>
<div>3rd DIV</div>
</div>
<div class='external-icons'>
<div class='logo-group'>
<a class='intro-logo-1 active'><img></a>
<a class='intro-logo-2'><img></a>
<a class='intro-logo-3'><img></a>
</div>
</div>
</div>
PLEASE NOTE : I don't want to remove the slick dots, it is just that, on pressing of the particular number slick dots, the active class should be added to that particular external button.
This is the screenshot of the section, I hope this will make you clear regarding my page layout and work.
I'm hoping with the help of you guys, I will learn new thing and will be able to get to my goal. Thanks
but $items.addClass('.img-logo');
seems wrong. It should be$items.addClass('img-logo');
. – JetobeforeChange
for slick slider and add the class according to the current slide. – Mohit Bhardwaj