Just been playing about with pointer-events
property in CSS.
I have a div
that I want to be invisible to all mouse events, except for :hover
.
So all click commands go through the div
to the one below it, but the div can report whether the mouse is above it or not still.
Can anyone tell me if this can be done?
HTML:
<div class="layer" style="z-index:20; pointer-events:none;">Top layer</div>
<div class="layer" style="z-index:10;">Bottom layer</div>
CSS:
.layer {
position:absolute;
top:0px;
left:0px;
height:400px;
width:400px;
}
pointer-events
in not well supported in IE. – Brande