javascript - How do you tell if one element is above another from results from querySelectorAll -


how tell if 1 element above (like after z indexes calculated) results queryselectorall.

don't think there easy solution, in there browser api call , element "z-height".

you approach problem how rendering engine working, stacking elements 1 on top of other based on dom tree depth. there css engine, changes element positions based on tag types , special rules css, such z-index, special position properties (relative, absolute, etc.) , css "quirks", example z-index + opacity changes how elements stacked.

based on goal, simplify parsing , ignore css doing , take html in consideration. there have dom api, makes traversing tree structure super easy , dom rendering engine handle weird cases of wrong-but-still-working markup.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -