Internet Explorer z-index fix

Posted by Grubersauce

If you have an HTML element that you are showing and hiding you may have some problems in Internet Explorer.  IE decides to reorder your z-index depending on whether the elements are positioned relative based on some arbitrary context.  Whatever.  Here is a quick fix using jQuery:

$(document).ready(function() {
     // Following fixes IE z-index bug so tooltips can work
    var zIndexNumber = 1000;
    $('div').each(function() {
        $(this).css('zIndex', zIndexNumber);
        zIndexNumber -= 10;
    });
 
}); 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Posted on: 12/23/2009 at 3:51 AM
Tags: , , , ,
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading