-
-
Notifications
You must be signed in to change notification settings - Fork 99
Reached & Dropped Events
The NgScrollReached
directive is an addon feature for the NgScrollbar
component in Angular. It emits events when the scroll position reaches specific points within the scrollable content.
The NgScrollReached
directive can be used by selecting one or more of the following output events:
(reachedTop)
(reachedBottom)
(reachedStart)
(reachedEnd)
Example
import { NgScrollbar } from 'ngx-scrollbar';
import { NgScrollReached } from 'ngx-scrollbar/reached-event';
@Component({
standalone: true,
selector: 'example-component',
template: `
<ng-scrollbar (reachedBottom)="onBottomReached()">
...
</ng-scrollbar>
`,
imports: [NgScrollbar, NgScrollReached],
})
export class ExampleComponent {
}
Name | Description |
---|---|
(reachedTop) | A stream that emits when scroll has reached the top. |
(reachedBottom) | A stream that emits when scroll has reached the bottom. |
(reachedStart) | A stream that emits when scroll has reached the left (right in RTL) |
(reachedEnd) | A stream that emits when scroll has reached the right (left in RTL) |
[reachedOffset] | Reached offset, default 0 |
[reachedTopOffset] | Reached top offset, falls back to reachedOffset value |
[reachedBottomOffset] | Reached bottom offset, falls back to reachedOffset value |
[reachedStartOffset] | Reached start offset, falls back to reachedOffset value |
[reachedEndOffset] | Reached end offset, falls back to reachedOffset value |
[disableReached] | Disable the directive, default false |
The NgScrollDropped
directive is an addon feature for the NgScrollbar
component in Angular. It emits events when the scroll position drops from specific points within the scrollable content.
The NgScrollDropped
directive can be used by selecting one or more of the following output events:
(droppedTop)
(droppedBottom)
(droppedStart)
(droppedEnd)
Example
import { NgScrollbar } from 'ngx-scrollbar';
import { NgScrollDropped } from 'ngx-scrollbar/reached-event';
@Component({
standalone: true,
selector: 'example-component',
template: `
<ng-scrollbar (droppedTop)="onTopDropped()">
...
</ng-scrollbar>
`,
imports: [NgScrollbar, NgScrollDropped],
})
export class ExampleComponent {
}
Name | Description |
---|---|
(droppedTop) | A stream that emits when scroll has dropped the top. |
(droppedBottom) | A stream that emits when scroll has dropped the bottom. |
(droppedStart) | A stream that emits when scroll has dropped the left (right in RTL) |
(droppedEnd) | A stream that emits when scroll has dropped the right (left in RTL) |
[droppedOffset] | Dropped offset, default 0 |
[droppedTopOffset] | Dropped top offset, falls back to droppedOffset value |
[droppedBottomOffset] | Dropped bottom offset, falls back to droppedOffset value |
[droppedStartOffset] | Dropped start offset, falls back to droppedOffset value |
[droppedEndOffset] | Dropped end offset, falls back to droppedOffset value |
[disableDropped] | Disable the directive, default false |
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