On a screen, to give off the illusion of 3D space between elements is not easy to do without a canvas or an engine to assist in the process. My question is whether or not you can get all of the elements that exist at a certain chosen X/Y coordinate in the browser.
Say you have two div's in a container that we can pretend is our "X/Y coordinates":
div {
width: 50%;
height: 200px;
float: left;
background: blue;
color: white;
}
.annoying {
position: absolute;
width: 100px;
left: 200px;
height: 100px;
background: red;
}
<div id="left">
Left side.
</div>
<div id="right">
Right side.
</div>
<div class="annoying">
Hmm, this gets confusing and unpredictable if I'm on the right side...
</div>
The idea is not "what can you click on?", but how can you determine what elements are in the z
view at a certain pixel. If I click on .annoying
when it is peering over the right side, I'd expect .annoying
and #right
. Clicking on the left side of .annoying
would result in .annoying
and #left
, if that makes sense.
This has me puzzled, and I have not the closest idea of how to approach this problem. Upon searching for Stack & Google, I was not able to find much on exact pixel matching.