This gives me auto: I need the number, so I can move one above the other?
// Swop div index
$("#panel div").each(function(){
alert($(this).css('z-index'));
});
This gives me auto: I need the number, so I can move one above the other?
// Swop div index
$("#panel div").each(function(){
alert($(this).css('z-index'));
});
I don't think that browsers handle the z-index the way you seem to be expecting them to. For elements without a z-index, there just isn't a value there (which is basically what "auto" means).
Elements with a z-index of auto are laid out in the order they appear in the document tree.
If you want one on top, make its z-index equal to the childNodes length of the parent. (or one more than the largest z-index of any of the child nodes, if there are any set).
Be sure to set the z-index as a string and not an integer, and parseInt to compare any existing z-indexes.