I'm using Slider Syncing from Slick.js
and need to control with only one navigator the other two.
<div class="main">
<div>content</div>
<div>content</div>
</div>
<div class="navigator">
<div>nav1</div>
<div>nav2</div>
</div>
<div class="secondary">
<div>content related with main1</div>
<div>content related with main2</div>
</div>
And this is my js code for that
var slickMainFrame = {
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
fade: true,
asNavFor: '.navigator',
};
var slickNav = {
dots: false,
slidesToShow: 2,
slidesToScroll: 1,
arrows: true,
fade: true,
asNavFor: '.main',
speed: 500,
};
$('.main').slick(slickMainFrame);
$('.secondary').slick(slickMainFrame);
$('.navigator').slick(slickNav);
This is not working at all.. I've tried using the asNavFor attribute of slickNav as an array or colon separated but it's not working neither. asNavFor: '.main, .secondary'
Try this:
HTML
<div class="main asnavForClass">
<div>content</div>
<div>content</div>
</div>
<div class="navigator">
<div>nav1</div>
<div>nav2</div>
</div>
<div class="secondary asnavForClass">
<div>content related with main1</div>
<div>content related with main2</div>
</div>
Javascript
var slickMainFrame = {
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
fade: true,
};
var slickNav = {
dots: false,
slidesToShow: 2,
slidesToScroll: 1,
arrows: true,
fade: true,
asNavFor: '.asnavForClass',
speed: 500,
};
$('.main').slick(slickMainFrame);
$('.secondary').slick(slickMainFrame);
$('.navigator').slick(slickNav);
Check the JSFiddle for a working example
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