asscroll icon indicating copy to clipboard operation
asscroll copied to clipboard

Multiple scroll areas

Open grommas opened this issue 2 years ago • 2 comments

Hi @ashthornton

I’m fiddling around with your scroller (again). Is it possible to have multiple scroll areas? It would be nice to have separated and smoothly scrollable areas. My current tests always have some glitches.

Codepen: Multiple scroll areas (test 1: one scroller) Codepen: Multiple scroll areas (test 2: multiple scrollers)

Any advice?

grommas avatar Jul 27 '21 11:07 grommas

This is something I have thought about adding before. It would be nice to have the option to create multiple instances and target multiple elements

But right now as you can see it would involve some really hacky methods in order to get this to work. The main issue is that ASScroll listens to wheel and scroll events on the window rather than the element you're scrolling, so it will scroll all instances at once. In theory this isn't too difficult to implement so I'll make this an enhancement and get round to it at some point!

The scrollbar should also be positioned correctly inside the scrollable element.

ashthornton avatar Jul 27 '21 16:07 ashthornton

Makes sense. So I’ll try to find another solution for now. Nevertheless it would be a great enhancement! Thanks for your reply!

grommas avatar Jul 28 '21 13:07 grommas