ngx-ui-scroll
ngx-ui-scroll copied to clipboard
Smoothscrolling
Hey!
At first, i really love your library. It was the only one for me, which is working really (!) well, after a small learningcourve.
Whatever, i'm trying to implement a smooth scrolling. Not the kind of "Scroll smooth to element X". The kind of, the user scrolls with his fingers and the scroll speed goes faster and faster.
I want to limit this speed and make the general scrolling smoother. I tried several plugins and even to develop my own, but i think there is no real scrolling happening in ngx-ui-scroll?
Has anybody a working solution or tips for me? Thank you! <3
@muchbetterug Thanks for using ngx-ui-scroll! Speaking of real scrolling, the library handles native scroll event on init (link) and periodically forces scroll position to jump back when there are new virtual items in the negative area (link). So I believe you may rely on native (browser) scroll API and push your custom handler before the Scroller's one.
Also, in case you want to deal with Scroller's handler you may try to use the Routines API (since vscroll 1.5.0) by forking ngx-ui-scroll. This API is quite new and typing seems not perfect, but here's an integration demo, where you may play with Routines.onScroll implementation: https://stackblitz.com/edit/angular-13-ngx-ui-scroll-3-vscroll-1-5-0-integration?file=src%2Fngx-ui-scroll%2Fui-scroll.component.ts (added "Scroll event init" console log).
Hope this helps, any suggestions for improvements are welcome.
@dhilt Thank you!
I poked a little bit around, but unfortunately i dont get working results. I would love this feature so much, i would even pay you. Is this okay? <3
I would love to throttle the scroll speed, when scrolling with the finger (or mouse etc.) and the second thing in another scenario, on scroll the next item should scroll into view.
Have a great day!
@muchbetterug I'm not sure about searching a solution for your particular case, but as I mentioned, it should be possible to enhance scroll behaviour on the viewport level without regard for virtual scroll implementation offered by ngx-ui-scroll (and vscroll under its hood). As an example I created a new demo for you where jquery-nicescroll plugin is used on top of virtual scrolling viewport: https://stackblitz.com/edit/ngx-ui-scroll-3-angular-13-nicescroll?file=src%2Findex.html. This is probably not exactly what you want (and also a bit sloppy due to setTimeout initialization), but it makes us sure that any other enhancement is possible.
Donation is welcome, use https://opencollective.com/ngx-ui-scroll.
Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed within seven days if no further activity occurs. If it needs to remain open, add the "permanent" label.
This issue has been automatically closed because it was stale.