Skip to content

Instantly share code, notes, and snippets.

Last active Jul 4, 2016
What would you like to do?
Find and Trump Z-Index on all Element on the Page
//add in our z-indexstuff
var index_highest = 0;
// Search all elements with '*'
$("*").each(function() {
var index_current = parseInt($(this).css("zIndex"), 10);
if (index_current > index_highest) {
index_highest = index_current;
//now the highest number is obtained and captured in the 'index_highest' variable - add 1 to it and assign to your element
//ref -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment