jquery隐藏一个包含闪光的div,而不用重置它 [英] jquery hide a div that contains flash without resetting it
问题描述
我已经写了一个使用jQuery UI的模式,它出现在Flash电影的前面,因此模态内的HTML变得腐败,我试图隐藏电影之前,模态被触发,并重新出现后关闭模式,效果很好,但是每一个.hide()和.show()flash动画会被重新设置,而我想要的就是隐藏(而不是删除电影)并显示它,一旦它被触发为.show模态div。
在FF / linux,FF / WinXp,IE / WinXp,Safari / WinXp中测试:
basic:
$ b
- 隐藏flash-div:$('#id_div_with_swf')。css(left
- 显示flash-div:$('#id_div_with_swf')。css(left,0px);
- 隐藏flash-div:$('#id_div_with显示flash-div:$('#id_div_with_swf')。animate({left:0_swf')。animate({left:-2000px},1000);
-
例子:
- put your flash container DIV into a new DIV with overflow:hidden.
- to hide flash-div: $('#id_div_with_swf').css("left","-2000px");
- to show flash-div: $('#id_div_with_swf').css("left","0px");
- to hide flash-div: $('#id_div_with_swf').animate({ left: "-2000px"},1000);
- to show flash-div: $('#id_div_with_swf').animate({ left: "0"},1000);
或者用动画效果显示和隐藏:
$ b $ ul
< div style =width:200px;高度:100像素; overflow:hidden;>
< div id =id_div_with_swfstyle =width:200px;高度:100像素;位置:相对;左:0像素;
< / div>
< / code< / div>
< >
您无法使用.css('visibility','可见'/'隐藏')
Greetings,
I have written a modal using jquery UI and it appears at the front of a flash movie thus the html inside the modal becomes corrupt, I tried to hide the movie right before modal gets triggered and reappears after closing the modal, works well but each .hide() and .show() the flash movie gets resetted while all I want is to hide (without removing the movie) and displaying it once it is triggered to .show that modal div.
解决方案 Tested in FF/linux, FF/WinXp, IE/WinXp, Safari/WinXp:
basic:
or, show and hide with animation effects:
html example:
<div style="width:200px; height:100px; overflow:hidden;">
<div id="id_div_with_swf" style="width:200px; height:100px; position:relative; left:0px; top:0px;">
<!-- flash here -->
</div>
</div>
you can't get a cross-browser working solution with .css('visibility', 'visible'/'hidden')
这篇关于jquery隐藏一个包含闪光的div,而不用重置它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!