How I can assgine it to multiple divs.
Dhaval8087 opened this issue · comments
Dhaval Patel commented
I have a multiple divs which classname is same and I want to apply scrollbar to all div is it possible because if I will use
var myScrollbar = new GeminiScrollbar({
element: document.querySelector('.my-scrollbar')
}).create();
it will take very first element how I can assign scroll to multiple element
Noel Delgado commented
Hi, you need to create an instance per every element.
The approach is up to you, the following is just an example:
var scrollbarElements = [].slice.call(document.querySelectorAll('.my-scrollbar'), 0);
scrollbarElements.forEach(function(element) {
new GeminiScrollbar({
element: element
}).create();
});
Dhaval Patel commented
@noeldelgado :Thanks I will check it and close it