-
-
Notifications
You must be signed in to change notification settings - Fork 101
Updated event
Murhaf Sousli edited this page Jul 27, 2021
·
3 revisions
The NgScrollbar component has an output (updated) which emits when:
- After its view is initialised
- Any of its inputs change
- Resize sensor emitted (e.g. the content size is changed)
Example: Fire an event when the vertical scrollbar becomes scrollable (vertical scrollbar becomes visible)
<ng-scrollbar #scrollbar="ngScrollbar" (updated)="onScrollbarUpdate(scrollbar.state)"></ng-scrollbar>onScrollbarUpdated(state: NgScrollbarState) {
if (state.isVerticallyScrollable) {
console.log('Scrollable');
} else {
console.log('Not Scrollable');
}
}Here is a demo stacbklitz
Become a sponsor and get your logo on our README on GitHub and the front page of https://ngx-scrollbar.netlify.com/.
Become a backer and get your logo on our README on GitHub.
Latest version (v15)
Addons:
Older version (v13)
- Demo for v13
- Usage
- Styling
- Global Options
- Pointer Events
- Scroll Event
- Updated Event
- Smooth Scroll Functions
- Performance tweak
- Integration
- Reached events