Created
September 22, 2022 06:53
-
-
Save FlameWolf/c743b1f24c6f3c58cf21caa16aae3604 to your computer and use it in GitHub Desktop.
Find the largest z-index in the document
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
const getMaxZIndex = function () { | |
const elements = [...document.querySelectorAll("body *")]; | |
return Math.max(...elements.map(x => parseInt(getComputedStyle(x, null).zIndex) || 0)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment