簡體   English   中英

加載時隱藏Flash SWF

[英]Hidding a Flash SWF upon loading

我有一個可能很簡單的問題,但是在這里或在Google上找不到答案。

我通過以下方式(使用JavaScript)在HTML頁面中加載SWF:

AC_FL_RunContent(
    "src", "${swf}",
     ....
    "type", "application/x-shockwave-flash",
    "pluginspage", "http://www.adobe.com/go/getflashplayer"
);

我嘗試添加以下行:

"style", "visibility: hidden"

但這沒有用。 我可以稍后使用以下方法使其可見或隱藏:

document.getElementById("flash").style.visibility = "hidden";

但是我想使閃光燈不可見,並稍后使它可見,但是要在AC_FL_RunContent中添加一個參數。

我希望有人可以幫助我。 非常感謝。

魯迪

魯迪,我們將需要查看函數AC_FL_RunContent(){...}。 您不能將任何喜歡的舊參數傳遞給函數。 它具有預定義的參數。 如果可見性是其中之一,那么它應該起作用。 如果不是,則需要添加一個隱藏元素的參數。

另外,隱藏元素的更好方法是使用display:none。

因此,也許您將為功能創建一個參數並將其命名為hideOnLoad。 然后,您可以將布爾值true傳遞給參數。 然后執行以下操作,並將其放入Flash元素后:

if (hideOnLoad) document.getElementById("flash").style.display= "none";

或者查看在何處創建“ flash”對象並添加.style.display:'none'。 或者,如果對象在開始時已經在DOM中,則只需向HTML元素添加style =“ display:none”。

<div style="position:relative;"><!-- this is a wrapper so that the cover will site directly over the flash. -->
   <div id="flash_uploader"></div><!-- this represents your flash, it is always visible -->
   <div id="flashCover" style="position:absolute; background: #fff; width: 100%; height: 100%; top: 0; left: 0;"></div><!-- this covers the flash until the flashvars are correct, hide it in your function when the flashvars are correct. -->
</div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM