0

I'm looking for something between display: none and visibility: hidden. In other words, I want for div element (with flash content) to be loaded, but not displayed at all.

To make it more clear: there is a flash object embedded through swfobject.embedSWF in the div. When I change display (via javascript) from block to none and then from none to block, it works different in different browsers:

in IE it works like I want it to work - I change the display to block and the object is still there, but in Chrome and FF it is loaded again, like for the first time when swfobject.embedSWF was called.

4

1 に答える 1

2

に設定してみませんか

HTML(ページのどこか)

<body>
  <!-- other code -->
  <div id="my-div">
    <!-- your object / embed code -->
  </div>
</body>

CSSで

#my-div {
  left: -9999px;
  position: absolute;
}

編集:あなたの質問をもう一度読んだとき、私は異なって理解しました...あなたはdivを見えないようにしたいです...そうですか?

したがって、以下で説明するjQuery呼び出しを引き続き使用して表示できます...ただし、非表示にしておきたい場合は、上記のCSSで十分です...それでもオブジェクトをレンダリングしてロードする必要があります

$("#my-div").css({ position: "static" });

// or
$("#my-div").css({ left: 0 });
于 2012-05-06T17:51:45.520 に答える