Open crispy-customs opened 1 year ago
This is because internally this library uses jquery to select the asNavFor item(s).
It looks like a fix would be fairly easy.
Relevant code form Slick.js
Slick.prototype.getNavTarget = function() {
var _ = this,
asNavFor = _.options.asNavFor;
if ( asNavFor && asNavFor !== null ) {
asNavFor = $(asNavFor).not(_.$slider);
}
return asNavFor;
};
Ok, so how would one go about to fix this? rewrite the asNavFor defined in slick? I'm not sure what that would look like.
Yes, if you really want to pass an array of DOM elements or jQuery objects, it would require altering the getNavTarget()
function.
Specifically
if ( asNavFor && asNavFor !== null ) {
asNavFor = $(asNavFor).not(_.$slider);
}
Alternatively, you could use a css class name to identify the other carousel(s).
asNavFor: '.dependent-navigations'
and just add the css class to the other navigations so you can target them. Honestly, this is probably the easiest way to accomplish what you want.
https://codepen.io/n-bagge/pen/Exebyaw
Test commented asNavFor settings in the codepen.
use this jsfiddle to reproduce your bug: http://jsfiddle.net/simeydotme/fmo50w7n/ we will likely close your issue without it.
====================================================================
Steps to reproduce the problem
====================================================================
What is the expected behaviour?
I need to specify the location of the navigation sliders in the each function for it to scale with multiple sliders on the same page.
====================================================================
What is observed behaviour?
No option to specify multiple navigation sliders using variables.
====================================================================
More Details