Fixing ie7 z-index stacking issue with jquery

Posted on the October 13th, 2010 under jQuery by

For some reason, Internet Explorer 7 does some pretty hair pulling dance for developers in fixing several obscure bugs. The  z-index stacking orders is one of them. One way to fix this is to dynamically reverse the default z-index stacking order of the elements.  This will ensure the elements higher in HTML source will have a higher z-index order on page, solving most of the IE stacking issues. Here is the jquery code:

$(function() {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});
VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)