albertogasparin/Optiscroll

multiple scrolls?

neuropass opened this issue · 1 comments

Hi Alberto,

How would I initiate multiple scrolls in a page in plain javascript?
Say I have the main element and then some other smaller elements I want optiscroll to work with.

EDIT:
this does not seem to be working:
var element = document.querySelectorAll("#scroll1, #scroll2");

Thanks!

With plain javascript you have to create multiple Optiscoll instances yourself, as providing multiple elements is not supported.
Something like this should do the trick:

var elements = document.querySelectorAll("#scroll1, #scroll2");
elements.forEach((el) => new Optiscroll(el))