Is there a way to trigger a function when a user scrolls up or down in an Angular 6 project?
I want to implement a feature similar to fullpage.js in my Angular 6 application. I initially attempted to achieve this using Angular animations, but without success. Now, I am utilizing ngx-scroll-to for scrolling to the current slide. Assume that I already know how to write functions like scroll_to_bottom_slide()
and scroll_to_top_slide()
. However, I am unsure about implementing the necessary events.
For example:
scrollDown(){
scroll_to_bottom_slide();
}
scrollUp(){
scroll_to_top_slide();
}