本文介绍了IE 6和IE 7中的z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个嵌套的div,如下所示:

I had a nested div as I show below:

<div id="header"><div class="header-content">
 <div class="button"></div>
 <div id="menu"></div>
</div>
  <ul>
    <li></li>
  </ul>
</div>

现在我的javascript代码如下:

Now my javascript code like that:

<script>
 $(".button").click(function(){
   $("#menu").css({
     position:"absolute",
     zIndex:50000,
     display:"block"
   });
 });
</script>

它在Firefox中工作正常,但在IE 6和IE 7中并不是最重要的.任何有经验的人都可以帮助我!

It's work fine in firefox but in IE 6 and IE 7 it's not above all. Any one had an experienced about this help me please!

推荐答案

完全相同

var show = function(){
  var menu = document.getElementById("menu");
  menu.style.position = "absolute";
  menu.style.zIndex = "50000";
  menu.style.display = "block";
  menu.style.top = 0;
}

在没有JQuery的情况下对我来说绝对正常.对于IE6和IE7.不幸的是,现在无法使用JQuery进行测试.

works absolutely fine for me without JQuery. For both IE6 and IE7. Unfortunately can't test with JQuery now.

此示例是您使用的确切代码吗?

Is this example the exact code you are using?

这篇关于IE 6和IE 7中的z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 03:52