質問

だから私はjQuery UIのダイアログボックスを使っています。しかし、私が読んだように、DropDown Listsがzインデックスキューに注意を払わないように、IE6内には一般的なバグがあります。私のオーバーレイウエイの世話をするためにBGIFRAMEと呼ばれる便利なプラグインがあることを読んでいます。私はそれを使うように言う2つの異なる方法を見つけました、そしてどちらの作業もしませんでした。私はただ本当に愚かな何かをしているかもしれませんが、私はこの作業を得る必要があります。

jquery.bgiframe.jsバージョン2.1.1を含む これは私が働かずにそれを使用しようとした2つの方法です。

  1. 実際のプラグインからのドキュメントはこれを行う:

    $("#selectDropdownThatNeedsFixing").bgiframe();
    
    .

    これは、オブジェクトが予想されることを言うjQuery例外を引き起こします。

  2. 次のページからの2番目の方法: http:// docs。 jquery.com/ui/dialog/dialog 基本的にあなたがダイアログを初期化するときにbgiframe: trueを設定するだけです:

    $( ".selector" ).dialog({ bgiframe: true });
    

    これはエラー解除されませんが、私がテストしたときにIE6内に問題が存在します。

    何かが足りない?どのような方法でBGiFrameを使用することになっていますか?どんな方向にも大いに評価されます。あなたの助けをありがとう!

役に立ちましたか?

解決

You don't need to use a plugin for this. The problem with IE6 and z-index is, positioned elements in IE6 generate a new stacking context starting with a z-index value of 0. Therefore z-index doesn’t work correctly in IE6. The workaround to this issue is to specify a z-index value in the parent selector that is equal to the z-index specified in the child selector.

Check working example at http://jsfiddle.net/ebgnu/2/

Below is the example i did in jsfiddle.

.parent{
    position: relative;
    color:white;
}
.parent#a {
    height: 2em;
    z-index: 1;
}
.parent#a .child{
    position: absolute;
    height: 6em;
    width: 2em;
    z-index: 1;
    background:blue;
}
.parent#b {
    height: 2em;
    background:red;
}

<div class="parent" id="a">
    <div class="child">a</div>
</div>
<div class="parent" id="b">
    <div class="child">b</div>
</div>

Look at .parent#a This is the parent of the child selector a that have a z-index of 1. In this example, a will be on top of b. let's say we want to make b on top on a. All we need to do is change values of both the child a and it's parent to z-index: 0. This will send it to the back.

他のヒント

I believe that you're supposed to call the bgiframe plugin on the dialog, not the < select >. The current jQuery UI version doesn't seem to list the bgiframe option for the dialog widget anymore.

The jQuery Exception you're getting seems to indicate, that the element that you're targeting doesn't exist for the selector specified (#selectDropdownThatNeedsFixing).

If the problem persists, try to use the IE Developer Toolbar to find out if the iframe is actually created.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top