Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.addEventListener("load", function () {
- const loadMores = document.querySelectorAll('[data-pf-type="ProductList"] a.pf-cmIldm');
- const observer = new IntersectionObserver(function (elements, observer) {
- elements.forEach((element) => {
- const el = element.target;
- const isDisabled = el.hasAttribute("disabled");
- if (element.isIntersecting && !isDisabled) {
- el.click();
- } else if (isDisabled) {
- observer.unobserve(el);
- }
- });
- });
- loadMores.forEach((loadMore) => {
- observer.observe(loadMore);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement