KingSora / OverlayScrollbars

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.
https://kingsora.github.io/OverlayScrollbars
MIT License
3.72k stars 214 forks source link

Allow to smooth scroll any element, not only OverlayScrollbars instance #445

Open plashenkov opened 2 years ago

plashenkov commented 2 years ago

Hi!

We already have the instance.scroll() method, but what if we want to scroll smoothly any scrollable HTML element, not necessarily customized with OverlayScrollbars?

Sure, we have native element.scrollTo({top: 100, behavior: 'smooth'}), but it doesn't allow us to controll scroll duration (it differs depending on scroll distance).

There are also other packages which allow us to do this. But since we use OverlayScrollbars and it already can do this, it would be great to have this function out-of-the-box.

andron13 commented 1 year ago

Hi. Were you able to solve the smooth scrolling issue?

KingSora commented 1 year ago

@plashenkov @andron13 I'll add the scroll function as an instance function and also as an static function in version2. I plan on releasing it end of september

plashenkov commented 1 year ago

Hi, @andron13! Yes, with the help of additional scroll-smooth package. But it would be nice OverlayScrollbars had this.

plashenkov commented 1 year ago

@KingSora Great!

plashenkov commented 1 year ago

@KingSora Could you consider adding horizontal smooth scroll as well? Even scroll-smooth cannot do that, AFAIK.

andron13 commented 1 year ago

@plashenkov @andron13 I'll add the scroll function as an instance function and also as an static function in version2. I plan on releasing it end of september

Hi, could i ask? have you done?