Flash 视频仍在使用 jQuery 删除的 DIV 上播放(IE 错误) [英] Flash video still playing on DIV that is removed using jQuery (IE bug)

查看:21
本文介绍了Flash 视频仍在使用 jQuery 删除的 DIV 上播放(IE 错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些 jQuery 标签,其中一个包含 Flash 视频.当我在一个标签中播放视频并在 FF 或 Safari 中点击另一个标签时,视频会随着声音停止,点击返回视频标签会重新加载内容 - 正如预期的那样.

I have some jQuery tabs one of which holds a flash video. When I play the video in one tab and click to another in FF or Safari the video stops along with the sound, clicking back to the video tab reloads the content - as expected.

在 Internet Explorer 中,情况并非如此,即使未选择选项卡,视频也会继续播放.我的理解是,当应用 display:none (jQuery hide()) 时,DOM 元素基本上从布局中删除 - 为什么 IE 浏览器不会发生这种情况,我该如何解决?

In Internet Explorer this is not the case, the video continues to play even when the tab is not selected. My understanding is that when display:none (jQuery hide()) is applied the DOM element is essentially removed from layout - why is this not happening with IE browsers, how can I fix it?

推荐答案

要删除视频然后重新添加它,请将以下内容添加到关闭视频窗口的函数中:

To remove the video and then re-add it, add the following to your function that closes the video window:

 // Remove and re-add video
 var clone = $("#video-holder").clone(true);
 $("#video-holder").remove();
 $("#video").html(clone);

您有一个环绕的视频"div,以及包含嵌入代码的视频持有者"div.

Where you have a surrounding "video" div, and inside a "video-holder" div that houses the embed code.

这篇关于Flash 视频仍在使用 jQuery 删除的 DIV 上播放(IE 错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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