- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I have a css display/positioning puzzle:
Is it possible to position an image so that it rests on top of other elements (z-index) but is treated as invisible for the purposes of mousing about underneath?
In other words, is there an attribute I can set so that it doesn’t prevent access to control elements (like links, buttons etc.) on lower layers?
If you cover things with anything, including an image, using z-index
, the stuff beneath it won’t be available to click on.
But there might be another way of going about what you’re trying to accomplish. Do you have a comp or image that we can look at to see what effect you’re going for?
No, I don’t have a specific project in mind. It’s just something that occasionally trips me up when I think I’ve been clever, and I was hoping it was just my ignorance of some super-secret setting that only the Illuminati know.
Not that I know of, but there are plenty of ways to skin a cat when we’re building this stuff. So the effect might be possible.
Heck you could change the z-index
on hover and the opacity of the stuff “below” to give a similar visual cue.
Johnny 5 need more input basically.
is there an attribute I can set so that it doesn’t prevent access to control elements on lower layers?
I do believe there is such a thing :
#topelement {
pointer-events: none;
}
That seems to do the trick — thanks very much. That’ll come in very handy :)
No problem, keep in mind support is pretty good but IE has only recently implemented it :
You might wanna consider a JS fallback for earlier versions.