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

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

问题描述

您好,我已经使用 jquery UI 编写了一个模态,它出现在 Flash 电影的前面,因此模态内的 html 已损坏,我试图在模态被触发并在关闭模态后重新出现之前隐藏电影,效果很好,但每个 .hide() 和 .show() Flash 电影被重置,而我想要的只是隐藏(不删除电影)并在它被触发后显示它以 .show 模态 div.

解决方案

已在 FF/linux、FF/WinXp、IE/WinXp、Safari/WinXp 中测试:

  • 将您的闪存容器 DIV 放入一个带有溢出的新 DIV:隐藏.

基本:

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

或者,使用动画效果显示和隐藏:

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

html 示例:

<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;" ><!-- 在此处闪烁-->

<小时>

您无法使用 .css('visibility', 'visible'/'hidden') 获得跨浏览器的工作解决方案

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隐藏一个包含flash的div而不重置它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆