I am using gliderJS to create a carousel and I need to dynamically add and remove items from and to it.
I managed to get it working with the .addItem
and .removeItem()
methods, and while the removeItem supports removing from specific index, I dont see any way in the documentation to addItem at a specific index, does anyone know if that is possible?
This is the code so far about adding:
const elementHTML = "somehtml";
const element = document.createElement("div");
element.innerHTML = elementHTML;
glider.addItem(element);
And that adds it at the end of the carousel, I want to add it at a specific index.