-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fade slider type not working when using Data Attributes #659
Comments
We're experiencing a similar issue with version 3.6.12 and this setup:
And since we have multiple running on one page...
|
Same problem here! Thanks for nice Slide lib! |
My workarround:I'm outputting the options as a property object coming from a custom controls interface, transforming them into JSON (JSON.stringify()). So the solution I gave was to change the attribute name to "use-strict";
document.addEventListener(
"DOMContentLoaded",
function () {
var spliders = document.querySelectorAll(".splide");
console.log(spliders);
for (let i = 0; i < spliders.length; i++) {
const el = spliders[i];
// MY HACK BELOW
const options = JSON.parse(el.getAttribute("data-slider"));
new Splide(el, options).mount();
}
},
false
); |
Maybe this helps the author for fix this bug. 👍 |
Fixed in v4.0.0 |
Thanks! Works again in v4. |
Checks
Version
v3.6.12
Description
Fade is working correctly when initialized with JS, it's not working with Data Attributes.
It's seems to be working with Splide 2.4.x, and broken since 3.1.x at least.
Reproduction Link
https://jsfiddle.net/2kmb85nh/6/
Steps to Reproduce
none
Expected Behaviour
Fade slider initialized by using Data Attributes should work.
The text was updated successfully, but these errors were encountered: