Question:
I have adiv
that has background:transparent
, along with border
. Underneath this div
, I have more elements.Currently, I’m able to click the underlying elements when I click outside of the overlay
div
. However, I’m unable to click the underlying elements when clicking directly on the overlay div
. I want to be able to click through this
div
so that I can click on the underlying elements.
Best Answer:
Yes, you CAN do this.Using
pointer-events: none
along with CSS conditional statements for IE11 (does not work in IE10 or below), you can get a cross browser compatible solution for this problem.Using
AlphaImageLoader
, you can even put transparent .PNG/.GIF
s in the overlay div
and have clicks flow through to elements underneath.CSS:
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review