EasyScrollDots
EasyScrollDots copied to clipboard
Visibility and multiple calls
I have situation where I hide elements that have scroll-indicator class. So I needed easyScrollDots to not display those. I see that you are mostly trying to not use jquery, so I attempted too, but admittedly, js is not my primary language. You may find a better way to implement isHidden. I simply used this https://stackoverflow.com/a/21696585/166231.
Additionally, I re-organized the code to allow easyScrollDots to be called multiple times (i.e. after some visibility changes). Again, a few things to note:
- With jQuery events, the way I understand it, if you remove an element that had events attached, it also removes events. I wasn't sure with 'event listener'. You can correct if wrong.
- I'm not sure if there is a way to detect which dot to make active after rebuild or not. If you know how, I'll let you think about it.