{"id":310,"date":"2011-07-18T19:01:57","date_gmt":"2011-07-18T19:01:57","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=310"},"modified":"2011-07-18T19:03:49","modified_gmt":"2011-07-18T19:03:49","slug":"ie-7-z-index-bug-drop-down-menus","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/ie-7-z-index-bug-drop-down-menus\/","title":{"rendered":"IE 7 z-index bug &#8211; drop-down menus"},"content":{"rendered":"<p>If you&#39;ve struggled to figure out why your drop down menus are showing behind other content, you may have come across the IE 7 z-index bug.<\/p>\n<p>Without duplicating the content on the many articles that discuss this issue, here&#39;s a quick way to resolve it with a little jQuery:<\/p>\n<h3>\n\tjQuery (to be run in your document.ready or document.load event)<\/h3>\n<p><code>$(&quot;<em>#menu-wrapper ul li<\/em>&quot;).parents().each(function() {<br \/>\n\t&nbsp;&nbsp;&nbsp; var p = $(this);<br \/>\n\t&nbsp;&nbsp;&nbsp; var pos = p.css(&quot;position&quot;);<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(pos == &quot;relative&quot; || pos == &quot;absolute&quot; || pos == &quot;fixed&quot;) {<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.hover(function() {<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(this).addClass(&quot;on-top&quot;);<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function() {<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(this).removeClass(&quot;on-top&quot;);<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br \/>\n\t&nbsp;&nbsp;&nbsp; }<br \/>\n\t});<\/code><\/p>\n<h3>css<\/h3>\n<p><code>.on-top { z-index: 10000; }<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#39;ve struggled to figure out why your drop down menus are showing behind other content, you may have come across the IE 7 z-index&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[77,12,5],"tags":[105,86],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/310"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":0,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}