I was wondering if there is a way, to detect if a div is effectively visible and not being occulted by another element?
Thank you
not2easy
4:54 pm on Mar 22, 2020 (gmt 0)
By any chance do you use any browser tools or extensions? The Web Developer extension for FF lets you examine objects and/or the CSS for the elements to see overlaps visually. It also allows 'test' (in browser) editing to see how to fix things. I believe Chrome offers the same kind of tools but I don't use theirs.
JorgeV
5:08 pm on Mar 22, 2020 (gmt 0)
Thank you @not2easy, in fact, I meant in Javascript, to detect if a div is occulted or not. I should have explained better.
When there is an adsense slot, above the fold, if there are not ads, adsense is not collapsing the slot, so instead there is an iframe, of he size of the slot, empty, with transparent background.
In the past, slots were collapsed, so I could detect and test the height of the div, to know if an ad was served or not. It's not longer possible, with slots above the fold. So, my "new" idea was to place a div under the slot, and after the page is loaded to test if this div is occulted or not. If it is, it means that an ad is being served, if the div is not occulted, then it means there is an iframe with transparent background above (= no ad).
I don't know if this is clear :)
not2easy
5:40 pm on Mar 22, 2020 (gmt 0)
My bad as well, should have noted that this was posted in the JavaScript and AJAX forum. Sorry, the confusion is mine ;)
JorgeV
9:44 am on Mar 31, 2020 (gmt 0)
Hello,
A little "up" , in case, but I guess it's not possible .
rainborick
4:33 am on Apr 4, 2020 (gmt 0)
You can find some good solutions by checking out various "lazy load" image codes,
JorgeV
9:46 am on Apr 6, 2020 (gmt 0)
Thank you @rainborick, however, all I can find about Lazy loading, is just detecting if an element is in the visible on the screen, no if another element is occulting (over) it.