-
Hello thank you for this awesome plugin! Im kinda new in this and i have a question. I would like to get the speed data from the scroll, like you guys have in your page (https://idiotwu.github.io/smooth-scrollbar/) when you user a plot to show the speed curve. Is there any function that i should be calling to get the value of the speed scroll. For example i would like to get the offset doing an: scrollbar.addListener( () => {scrollbar.offset}) And then, get the offset for X and Y. Is there any way to get the speed like: Because i would like to animate dom elements using the speed that i get for every addListener value i get Kind Regards, Pio |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Since the speed is given by you need to record the last offsets and compare it with current ones. Here is the implementation from the demo page: smooth-scrollbar/__demo__/scripts/monitor.ts Lines 414 to 435 in b8e4005 |
Beta Was this translation helpful? Give feedback.
-
Thank's my friends! Solved!! |
Beta Was this translation helpful? Give feedback.
Since the speed is given by
you need to record the last offsets and compare it with current ones.
Here is the implementation from the demo page:
smooth-scrollbar/__demo__/scripts/monitor.ts
Lines 414 to 435 in b8e4005