Is there a way to use pointer-events: none
to disable click events on a specific container while still allowing scroll functionality and an overlay?
You can view my fiddle here: https://jsfiddle.net/1eu6d3sq/1/
Currently, when I apply pointer-events: none
to the container, it disables all events. When I remove this property, all events are enabled.
Here is the CSS code:
.parent {
position: relative;
pointer-events: none;
}
.button {cursor: pointer}
.main {
height: 80px;
overflow: auto;
}
.mask {
z-index: 1000;
pointer-events: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
cursor: default;
height: 100%;
}
And the HTML:
<div class="parent"><div class="main">
...
I am trying to find a way to make the parent DOM element only listen to scroll events instead of disabling all events with pointer-events
.
I attempted adding an event listener for scroll but the function does not get triggered.
Any suggestions?