tarun-dugar / easy-scroll

A lightweight native javascript library to perform smooth scrolling with animation
MIT License
121 stars 11 forks source link

Multiple calls of easyScroll() end up not working #7

Open yevgeniy-belov opened 4 years ago

yevgeniy-belov commented 4 years ago

I'm calling easyScroll() couple of times in a row. First call - everything works as expected. Second call - the duration/speed of the animation is slowing down to ~half. Third call - the script is stuck. Probably the duration is very long.

tarundugar commented 4 years ago

@cssberries ill check

Cuperino commented 4 years ago

I call easyScroll() multiple times in a row and don't have this issue. I did notice previous calls continue to run in the background until the animation completes, even if their results are not visible because the more recent calls to requestanimationframe shadow previous calls.

What versions of which browsers are/were you using @cssberries? I've personally tested this on the current Firefox 74.0 and Google Chrome 80.0.3987.149.

yevgeniy-belov commented 4 years ago

It was Chromium 77.0.3844.0.

tarun-dugar commented 4 years ago

@cssberries are you calling it back to back for the same element?