gpt4 book ai didi

javascript - 在Firefox中隐藏元素时,YouTube播放停止

转载 作者:行者123 更新时间:2023-12-03 06:03:35 25 4
gpt4 key购买 nike

我试图在播放时隐藏YouTube视频。在Chrome中,效果很好,但在Firefox中,隐藏时播放停止。

这是我单击#hide的代码

$('#hide').click(function(){
$('.flash-wrapper').toggleClass("hidden");
$('#footer').fadeToggle();
var hideText = $('#hide').text();
if(hideText == "Hide everything") {
$('#hide').text('Show everything');
} else {
$('#hide').text('Hide everything');
}
});

隐藏类
.hidden {
position: absolute;
left: -10000px;

}

一个.flash-wrapper的示例
<div class="flash-wrapper Jj6yXxVc21Y">
<div id="Jj6yXxVc21Y">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
<script type="text/javascript">

var params = { allowScriptAccess: "always" };
var atts = { id: "Jj6yXxVc21Y" };
swfobject.embedSWF("http://www.youtube.com/v/Jj6yXxVc21Y&enablejsapi=1&playerapiid=ytplayer", "Jj6yXxVc21Y", "250", "25", "8", null, null, params, atts);

</script>
</div>

闪存包装类
.flash-wrapper {
float: left;
margin-left: 5px;
}

最佳答案

我将.hidden更改为以下代码,现在播放不停止

.hidden {
margin-top: -1000px;
}

关于javascript - 在Firefox中隐藏元素时,YouTube播放停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9241889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com