onclick - html div: opaque, but allowing click to reach element behind -


i want make flicking div (alternating display:none) in front (z order) of element, if user clicks element in exact moment div appearing, div receives click, not element.

how can make div transparent clicks? is, can ignore clicks onclick event goes element behind div?

use pointer-events: none;:

div {width: 150px; height: 150px; background: #eee; position: relative; margin: 0}  div:hover {border: 1px solid black}  #over {width:50px; height: 50px; position: absolute; background: red; top: 55px; left: 55px; pointer-events: none}
<div onclick="alert('click caught')"></div>  <div id="over"></div>


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

python - GitPython: check if git is available -

How to merge four videos on one screen with ffmpeg -