So i am lazy loading my images (lazy load is done by another script)
now as the divs and imgs lazy load, i am using intersection observer to get the ids, but it only gets first 6 ids and does not the rest of them, Please help
MY JS FILE
const targets = [...document.getElementsByName('item-id')];
const options = { };
let clickedId_test;
const observer = new IntersectionObserver(function(entries, observer)
{
entries.forEach(entry => {
if (!entry.isIntersecting) {
return;
}
clickedId_test = entry.target.value
console.log(clickedId_test)
});
},
options);
targets.forEach(like_button => {
observer.observe(like_button);
})
Pics to See whats Happening