Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Multiple scroll areas #61

Open
grommas opened this issue Jul 27, 2021 · 2 comments
Open

Multiple scroll areas #61

grommas opened this issue Jul 27, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@grommas
Copy link

grommas commented Jul 27, 2021

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?

@ashthornton
Copy link
Owner

ashthornton commented Jul 27, 2021

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 ashthornton self-assigned this Jul 27, 2021
@ashthornton ashthornton added the enhancement New feature or request label Jul 27, 2021
@grommas
Copy link
Author

grommas commented Jul 28, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants