I am using 2 sliders, a nav and a main slider. When changing the slides dynamically the data-slick-index is incorrect.
To solve this problem currently I am re-assigning the indexes with a setTimeout to wait for slick to finish its business first.
setTimeout(() => {
if (!fresh) {
const list = document.querySelector('.slider-nav');
let elements = list.querySelectorAll('.ng-star-inserted');
console.log(elements);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('data-slick-index', i.toString());
}
}
}, 50);
Hi,
I am using 2 sliders, a nav and a main slider. When changing the slides dynamically the data-slick-index is incorrect.
To solve this problem currently I am re-assigning the indexes with a setTimeout to wait for slick to finish its business first.