Snippets / JS
JS
Infinite Scroll Post Feed Elementor Pro
A
Arwenia
·
129 views
·
Updated 1 year ago
Add infinite load scroll post feed
Add the custom code elementor pro to <body> - Start
<script>
let dhLoadMoreObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
let dhLoadMoreButton = document.querySelector('.ts-load-more');
if (dhLoadMoreButton) {
dhLoadMoreButton.click();
}
}
});
});
document.addEventListener("DOMContentLoaded", function() {
let dhLoadMoreButton = document.querySelector('.ts-load-more');
if (dhLoadMoreButton) {
dhLoadMoreObserver.observe(dhLoadMoreButton);
}
});
</script>
JS · 18 lines
Discussion
Ask a question or share how you used this.
Log in
to join the discussion.
No comments yet — be the first.