The
Palm
Civet

Posts tagged ie

fixing internet explorer’s z-index bug with jquery

one of the most common and most frustrating bugs when dealing with internet explorer 6 & 7 is the way it can screw up the stacking order of elements’ z-index properties. this can make setting up things like a suckerfish style dropdown menu less fun than paying taxes.

here is a jquery clip that will solve most ie related z-index issues, by reading the dom from top to bottom and making sure that every element has a higher z-index than the next. just customize your array of elements at the top of the each() function.


if (jQuery.browser.msie) {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
}

{via}

compiling and sharing code, ideas, and tools for making better websites and applications.

by justin talbott {email me}

what is a palm civet?