Created
November 9, 2012 14:23
-
-
Save harpalsingh/4045966 to your computer and use it in GitHub Desktop.
IE7 Issue when reusable parent elements have a position attribute and new dynamic content is required to sit on a higher z-index. This is presents itself when say you use the same two divs with a position attribute of relative but no z-index and then the
This file contains hidden or 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
Example of code where code applies:- | |
<div class="mydiv"> | |
<div class="dynamic_content"> | |
</div> | |
</div> | |
<div class="mydiv"> | |
</div> |
This file contains hidden or 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
if($.browser.msie && parseInt($.browser.version, 10) == 7) { | |
this.$target.closest('.className').css('z-index','1'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of possible code
The .mydiv both share CSS styling and a position:relative therefore in IE7 both are given a z-index of 0, applying a z-index on .dynamic_content will not work when the parent matches that of the div below, so need to dynamically apply a z-index to a single repeatable element and solution above aims to do that with Jquery to find the nearest reusable div and give it a z-index of 1.