Last active
May 17, 2023 21:43
-
-
Save chirag64/96d0a16327262af5f1f198661f23e244 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('scroll', (evt) => { | |
const loadMoreBtn = document.querySelector('.loadMoreBtn'); | |
if ((loadMoreBtn.offsetTop) < (scrollY + 1000)) { | |
loadMoreBtn.click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment