I need to count li and then add the z-index in reverse order to look like this:
<li style="z-index:3;"></li> <li style="z-index:2;"></li> <li style="z-index:1;"></li>
I don't want 0 or negatives for any z-indices, and this should be in reverse order. I would like to use jQuery since I will not know how many li will be in this list.
Here is what I still have:
var numIndex = $("ul.progress li").length + 1; $("ul.progress li").each( function(numIndex) { $(this).css("z-index", numIndex*-1); });
Please let me know if you know what I am missing.
source share