Skip to content

Instantly share code, notes, and snippets.

@ginpei
Last active September 3, 2021 08:15
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ginpei/073ab5d4679356f29585a9ae02277012 to your computer and use it in GitHub Desktop.
Save ginpei/073ab5d4679356f29585a9ae02277012 to your computer and use it in GitHub Desktop.
((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);
@ginpei
Copy link
Author

ginpei commented Jun 11, 2018

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment