0

One example I can give:

.nightly{
  z-index: 9000; 
  position: fixed; 
  height: 100%; 
  width: 100%; 
  background-color: rgba(0,0,0,0.5);
}
<div class="nightly">
</div>

<div class="body">
  <button>Test</button>
  <a href="#">Test 1</a>
</div>

Wanted to know how about the div.nightly" transparent "for clicks, or can click the button, link, etc. below it?

Leonardo
  • 237
  • 1
  • 10

2 Answers2

6

Yep in your CSS add pointer-events : none; The clicks will pass through.

Jeremy Thille
  • 26,047
  • 12
  • 43
  • 63
0

For IE (from here):

//This is an IE fix because pointer-events does not work in IE
$(document).on('mousedown', '.nightly', function (e) {

    $(this).hide();
    var BottomElement = document.elementFromPoint(e.clientX, e.clientY);
    $(this).show();
    $(BottomElement).mousedown(); //Manually fire the event for desired underlying element

    return false;

});
Community
  • 1
  • 1
Huelfe
  • 1,776
  • 16
  • 25