Find Highest Z-Index Position
5
Ever wanted to determine what is the highest Z-Index out of everything displayed on your page, so that you can move an object to a higher position? Well the code below will do exactly that, it's not my own code, I've been using it for quite a few months now, so unfortunately I cannot remember where I got it from.
function docjslib_findHighestZ() {
var documentDivs = new Array();
documentDivs = document.all.tags("DIV");
var highestZ = 0;
for (var i = 0; i < documentDivs.length; i++) {
var Zindex = documentDivs[i].style.zIndex;
if (Zindex > highestZ) {
highestZ = Zindex;
}
}
return highestZ;
}
Comments
Sat. Aug. 26th, 2006 8:36 AM
psykoprogrammer
psykoprogrammer





