Handle multiple slider containers

This commit is contained in:
Atanas Penchev 2023-03-10 13:16:18 +02:00
parent 52a8a34d81
commit 65e1d170ba
1 changed files with 12 additions and 9 deletions

View File

@ -704,16 +704,19 @@
}, slider.vars.animationSpeed + 100);
} else {
var keyframes = {};
keyframes[slider.prop] = [
slider.container.css(slider.prop),
slider.args[slider.prop]
];
slider.container.each(function() {
var container = this;
var keyframes = {};
keyframes[slider.prop] = [
window.getComputedStyle(container)[slider.prop],
slider.args[slider.prop]
];
slider.container[0].animate(keyframes, { duration: slider.vars.animationSpeed, easing: easing }).onfinish = function() {
slider.container.css(slider.args);
slider.wrapup(dimension);
};
container.animate(keyframes, { duration: slider.vars.animationSpeed, easing: easing }).onfinish = function() {
container.style[slider.prop] = slider.args[slider.prop];
slider.wrapup(dimension);
};
});
}
} else { // FADE:
if (!touch) {