jquery隐藏一个包含闪光的div,而不用重置它 [英] jquery hide a div that contains flash without resetting it

查看:105
本文介绍了jquery隐藏一个包含闪光的div,而不用重置它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,
我已经写了一个使用jQuery UI的模式,它出现在Flash电影的前面,因此模态内的HTML变得腐败,我试图隐藏电影之前,模态被触发,并重新出现后关闭模式,效果很好,但是每一个.hide()和.show()flash动画会被重新设置,而我想要的就是隐藏(而不是删除电影)并显示它,一旦它被触发为.show模态div。

解决方案

在FF / linux,FF / WinXp,IE / WinXp,Safari / WinXp中测试:


  • 将您的Flash容器DIV放入一个带有overflow:hidden 的新的DIV中。


basic:
$ b


  • 隐藏flash-div:$('#id_div_with_swf')。css(left
  • 显示flash-div:$('#id_div_with_swf')。css(left,0px);


  • 或者用动画效果显示和隐藏:
    $ b $ ul

  • 隐藏flash-div:$('#id_div_with显示flash-div:$('#id_div_with_swf')。animate({left:0_swf')。animate({left:-2000px},1000);



  • 例子:

     
  • < 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:

    • put your flash container DIV into a new DIV with overflow:hidden.

    basic:

    • to hide flash-div: $('#id_div_with_swf').css("left","-2000px");
    • to show flash-div: $('#id_div_with_swf').css("left","0px");

    or, show and hide with animation effects:

    • to hide flash-div: $('#id_div_with_swf').animate({ left: "-2000px"},1000);
    • to show flash-div: $('#id_div_with_swf').animate({ left: "0"},1000);

    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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆