Issue
@HostListener('window:scroll', ['$event'])
onWindowScroll() {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
console.log('reached bottom');
}
}
It is working of this code as above, but it occured many times even not reached exactly end of bottom.
How to check wheather scroll is reached to end of bottom?
Solution
if (window.innerHeight + window.scrollY === document.body.scrollHeight) {
console.log('bottom');
}
I found it.
Answered By - Jun An
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.