scarstens
6/27/2015 - 1:33 AM

Javascript snippet should be loaded "on page load" and it should attach itself to any elements on the page that are abusing z-index (anythin

Javascript snippet should be loaded "on page load" and it should attach itself to any elements on the page that are abusing z-index (anything over 999) and brings them back down to 99 by building a style element after the element found. Does not fix elements with inline !important styles, which are impossible to override.

//todo: needs to somehow use the .on function to attach to elements created after pageload
jQuery('[style*="z-index"]').each(function() {
	var zi = $(this).css("z-index");
	if(zi > 999){
		newstyle = jQuery('<style class="zindex2big" type="text/css"> #'+this.id+'{ z-index=99 !important;} </style>').insertAfter(this);
	}
});