Open senti-lozada opened 1 year ago
I also needed the scroll event, this was the solution I used.
on .html
<pdf-viewer (after-load-complete)="listenScroll()" ...otherProps></pdf-viewer>
and on .ts
constructor(
@Inject(DOCUMENT)
private document: Document,
private renderer: Renderer2
) { }
listenScroll(): void {
const scrollableEl = this.document.querySelector<HTMLDivElement>('.ng2-pdf-viewer-container');
if (!scrollableEl) { return; }
this.renderer.listen(scrollableEl, 'scroll', (event: Event) => {
// do anything
});
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report or Feature Request (mark with an
x
)Would like to ask if there are any events that can be used on tag, I was hoping to use (scroll) event when it has scroll for limited height ex.
<pdf-viewer (scroll)="onScroll($event)" [show-all]="true" [src]="fileBytes" *ngIf="fileBytes" style="width: 100%; height: 100%;" [zoom]="zoom_to">
Thank you,