I have in my page two sliders which share the same options:
var options1 = {
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 310,
itemMargin: 5
}
var options2 = {
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false
}
And then I have something like this:
$('#carousel').flexslider(options1);
$('#slider').flexslider(options2);
$('#carousel2').flexslider(options1);
$('#slider2').flexslider(options2);
The problem is I need to add to the end of the options one option that is different for each one, which is this: asNavFor: '#slider' for options1 and sync: "#carousel" for options two. I tried this but it didn't work:
$('#carousel').flexslider(options1, {asNavFor: '#slider'});
$('#slider').flexslider(options2, {sync: "#carousel"});
$('#carousel2').flexslider(options1, {asNavFor: '#slider2'});
$('#slider2').flexslider(options2, {sync: "#carousel2"});
I want to avoid repeating the options because they're the same for every slider. Thanks in advance!
Object.assign