Created
June 27, 2015 01:33
-
-
Save scarstens/ac16b108dc9d436a46b1 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment