I\'m using jQuery in my site and I would like to trigger certain actions when a certain div is made visible.
Is it possible to attach some sort of \"isvisible\" even
What helped me here is recent ResizeObserver spec polyfill:
const divEl = $('#section60'); const ro = new ResizeObserver(() => { if (divEl.is(':visible')) { console.log("it's visible now!"); } }); ro.observe(divEl[0]);
Note that it's crossbrowser and performant (no polling).