on-internet
← Community

Scroll height and document height units

Stack Overflow ·

When the window slides, it can detect the current height, but I don't know the unit of this height. I hope to get the total height (bottom height) using Angular. The height of the document is different from the height unit of the scroll. How do you convert between the two? Or in what way do you get the common unit? For example: import {HostListener,Inject} from "@angular/core"; import { DOCUMENT } from "@angular/platform-browser"; constructor(@Inject(DOCUMENT) private document: Document {} ngOnInit() { } @HostListener("window:scroll", [])onWindowScroll() { //.scrollTop console.log(this.documen

Comments

Sign in or sign up to comment and upvote.

No comments yet.