/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function findHighestZIndex(elem) { var elems = document.getElementsByTagName(elem); var highest = 0; for (var i = 0; i < elems.length; i++) { var zindex=document.defaultView.getComputedStyle(elems[i],null).getPropertyValue("z-index"); if ((zindex > highest) && (zindex != 'auto')) { highest = zindex; } } return highest; }