Working on a bunch of code, couldn't easily copy the part in here that seems broken because I'm not sure where the problem is at. Situation: there's text inside a div that I need to make selectable, but there's an other div with higher Z-index on top that doesn't allow me to select the text in the lower-z-indexed div. Any idea how to solve this?
Asked
Active
Viewed 292 times
-3
-
Add related code here https://jsfiddle.net/ and someone will surely help – Andrei Maieras Aug 06 '15 at 10:03
-
1If you don’t need to be able to “interact” with the upper element, then `pointer-events` could help solve this. – CBroe Aug 06 '15 at 10:06
-
Try this example http://stackoverflow.com/questions/12243898/how-to-select-all-text-in-contenteditable-div – Sajitha Rathnayake Aug 06 '15 at 10:10
1 Answers
3
This is what I did:
#b{
position:fixed;
background-color: blue;
opacity:0.5;
z-index:5;
pointer-events: none;
}

Ahs N
- 8,233
- 1
- 28
- 33
-
1Should be noted that `pointer-events` are IE11 and up only. - http://caniuse.com/#feat=pointer-events – Paulie_D Aug 06 '15 at 10:18