Skip to content

Instantly share code, notes, and snippets.

@harpalsingh
Created November 9, 2012 14:23
Show Gist options
  • Save harpalsingh/4045966 to your computer and use it in GitHub Desktop.
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
Example of code where code applies:-
<div class="mydiv">
<div class="dynamic_content">
</div>
</div>
<div class="mydiv">
</div>
if($.browser.msie && parseInt($.browser.version, 10) == 7) {
this.$target.closest('.className').css('z-index','1');
};
@harpalsingh
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment