Event doesn't work

i have a div which has a child div. something like
<div>
<div></div>
</div>
<div>
<div></div>
</div>
the first div covers the second div fully, so i want to create an event for the second div but because of the second i can't. till now i have tried pointer-events and changing the z-index.
9 Replies
xposedbones
xposedbones15mo ago
Not sure what you mean by creating an event. Can you provide a screenshot and/or describe your use-case and the desired outcome?
13eck
13eck15mo ago
What's your current code look like? What have you tried? So far you've given us nothing to work with, sadly.
ME
ME15mo ago
This is not my main project but it creates the same problem
ME
ME15mo ago
No description
No description
No description
ME
ME15mo ago
No description
Mannix
Mannix15mo ago
to what element you added pointer-events?? it seems to work https://codepen.io/MannixMD/pen/LYMYbax
Mannix
CodePen
LYMYbax
...
__araceli
__araceli15mo ago
Hi, not sure if you already solved this, but when you put pointer events none on an element, the children inherit it. So you will need to put pointer events: all in the item you want to interact
java8031
java803115mo ago
On the code pen you have
.outer{
position: relative;
top:0;
left:0;
width: 12rem;
z-index: 1;
height: 12rem;
background: rgba(24,12,213,0.6);
/* pointer-events:none; */
}
.outer{
position: relative;
top:0;
left:0;
width: 12rem;
z-index: 1;
height: 12rem;
background: rgba(24,12,213,0.6);
/* pointer-events:none; */
}
removing the pointer-event: none will make it work, it is preventing the entire element and its children from being clickable or interactive.
Ssadiq Roy
Ssadiq Roy15mo ago
From what I see in your html the .inner element is not in the .outer element. It is just indented.
Want results from more Discord servers?
Add your server