http://jsfiddle.net/aintnobody/0L1yumpe/
vs the same code on
http://www.aintnobodymusic.com/monkey
The issue: On the fiddle, everything works as it should. The image above in all cases is ignored via pointer-events: none, and the click passes through to whatever is underneath. We can tell this via the event listener for the bottom two, and since the top 4 are youtube iframe embeds, we can tell because the click starts the video (these are live vids, btw, so be sure to click in the center or you may be taken to youtube).
So, all is well... until I put it up on a site. I've tried four times in both local and hosted environments, and I always get the same result: The bottom two behave as expected, and the click goes through the image to the div below. However, the iframe (youtube) does not register the click IF 100% of it's pixels are covered by the image above. If even one pixel is exposed, it clicks through as it should. This is why the "short" set is there. The images above those videos are exactly one pixel narrower than the video underneath.
In firefox,however, the videos that are 100% covered will not trigger. It works fine in Chrome and Safari that I have tested so far, but not in firefox.
I can't find a single mention of this issue anywhere.
I've done test after test to narrow down what is happening here.
Is this a youtube issue? A firefox issue? An iframe issue? Could it have to do with the lack of an origin tag on the iframe? Perhaps some difference in the configuration of my document's head vs fiddle? I've tried similar on codepen as well, and it works just fine (clicks pass through)... until I put it up on a site and use firefox.
edited to add: just did simplified case on codepen as well, and clicks go through just fine on there, but not when I host:
http://codepen.io/oompaLoompa/pen/QwqRER
<iframe
class="video full jpgOverVideoFull"
width="200"
height="150"
src="https://www.youtube.com/embed/DEzREJbln-o"
frameborder="0"
allowfullscreen>
</iframe>
<div class="image full jpgOverVideoFull"
style="background-image:url('http://images.nationalgeographic.com/wpf/media-live/photos/000/247/cache/proboscis-monkey-in-tree_24704_600x450.jpg');"
>jpg full vid</div>
<iframe
class="video full pngOverVideoFull"
width="200"
height="150"
src="https://www.youtube.com/embed/DEzREJbln-o"
frameborder="0"
allowfullscreen>
</iframe>
<div class="image full pngOverVideoFull"
style="background-image:url('http://www.whaleoil.co.nz/wp-content/uploads/2012/05/monkey.png');"
>png full vid</div>
and the css:
.video, .image, {
height:150px;
position: absolute;
font-size:30px;
color:#F2F;
text-align: center;
}
.image {
z-index:1;
pointer-events: none;
background-size: cover;
}
.jpgOverVideoFull {
top:20px;
left:20px;
}
.pngOverVideoFull {
top:190px;
left:20px;
}
.full {
width:200px;
}
.short {
width:199px;
}