-
-
Save cjzopen/003b18109fb92d0b9686db8146e61bd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((document, limit) => { | |
const data = Array.from(document.querySelectorAll('*')) | |
.map((el) => ({zIndex: Number(getComputedStyle(el).zIndex), element: el })) | |
.filter(({ zIndex }) => !isNaN(zIndex)) | |
.sort((r1, r2) => r2.zIndex - r1.zIndex) | |
.slice(0, limit); | |
console.table(data); | |
})(document, 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment