【发布时间】:2012-03-03 01:45:29
【问题描述】:
在 Chrome/Safari 中,一旦灯箱关闭,Vimeo 视频将继续在后台播放。此时“分离”可以停止视频,但是当您关闭灯箱并单击菜单项以重新打开视频时,视频 div 为空白。我尝试了“克隆”和“附加”,但无法重新输入视频。
网站功能: 单击“a”“b”“c”,视频会出现灯箱。 点击灯箱中的“X”,灯箱内容关闭。
HTML/CSS
a id="alphaa" <------ The a, b, c menu item, when clicked, open the lightbox
.abcbox_content <------- The div that holds all the content for the lightbox
#videowrapper <------ div that holds the Vimeo iframe
.abc-align-right <---- the "X" to close the lightbox
这是我目前拥有的 jQuery。
<script type="text/javascript">
$(document).ready(function(){
$(".abc-align-right").click(function() {
$("#videowrapper").clone(true);
$("#videowrapper").contents().detach();
if ($(".abcbox_content").is(':visible'))
$("#videowrapper").append();
}); });
</script>
感谢您的帮助
【问题讨论】:
标签: jquery video append detach