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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -