I have one transparent div with id=1
, and I need to pass mouse events to all underlying divs (regardless of class / id) while keeping this transparent div reactive to it's own mouse events.
So selecting underlaying divs by class/id, and pointer-events: none
/ display: none
are not the options.
$('#1').mouseenter(function() {
$(this).css('background','rgba(0, 120, 255, 0.3)');
});
$('#a').mouseenter(function() {
$(this).css('background', 'red');
});
$('#1').mouseleave(function() {
$(this).css('background','rgba(0, 120, 255, 0.2)');
});
$('#a').mouseleave(function() {
$(this).css('background', '#555555');
});
How can this be achieved in a class/id independent way?
If it means anything, I have only 1 underlying div at the same time, but that div can have any class / id.