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

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

问题描述

我有一些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,并在视频支架嵌入代码。

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

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

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