0

IE7 の z-index の操作に問題があります。私はたくさんの調査を行いましたが、まだ問題を解決できません。

私は持っている

4 buttons with drop down menu. The dropdown menu has absolute position and have z-index of 9999;

 ----     ----    -----    -----
|    |   |    |  |     |  |     |
 ----     ----    -----    -----
dmenu    dmenu    dmenu    dmenu

another 4 buttons with popup images that pop on top of the button. The images also have absolute position and have z-index of 9999;

 pop img   pop img  pop img     pop img
 ----       ----    -----      -----
|    |     |    |  |     |    |     |
 ----       ----    -----      -----



 I want dropdown menu will cover the buttons below and and pop images will cover the button above. 

Chrome と FF ではすべて正常に動作しますが、IE では動作します。ドロップダウン メニューは、下のボタンを覆うのではなく、下のボタンの後ろに表示されます。

上のボタンはドロップダウン メニューの親で、下のボタンはポップ イメージの親です。

私が試してみました

1.上下のボタンの相対位置を設定します。

2.このスクリプトを実行します

   var zIndexNumber = 1000;
       // Put your target element(s) in the selector below!
       $("div").each(function() {
               $(this).css('zIndex', zIndexNumber);
               zIndexNumber -= 10;
               console.log($(this));
       });

上記のスクリプトはドロップダウン メニューを修正して下のボタンを覆うようにしますが、ポップ イメージの z-index が低いため、上のボタンもポップ イメージを覆うようにします。

私は今とてもイライラしており、助けが必要です。本当にありがとう!

4

1 に答える 1

0

これを試してください: ドロップダウンの親に position:relative があることを確認してください。 IE 6 および IE 7 の Z-Index 問題 通常、この場合の ul には display:block も含まれていることを確認します。

もう 1 つの方法は、親の z-index をより低い数値に設定し、ボディに 0 の z-index を適用してページの z-index を設定することです。

于 2012-08-25T03:02:33.180 に答える