Skip to content

Instantly share code, notes, and snippets.

@ambar
Created August 11, 2011 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambar/1139057 to your computer and use it in GitHub Desktop.
Save ambar/1139057 to your computer and use it in GitHub Desktop.
get max z-index under certain element
var getMaxZ = function(el) {
return Math.max.apply(null, $(el||document.body).children().map(function(){ return $(this).css('zIndex')>>>0; }).get())
};
@ambar
Copy link
Author

ambar commented Dec 9, 2011

应用需要注意极值的情况,比如 chrome z-index 为 2147483647

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