-1

我正在使用 fancybox2 插件。

当我单击图像滑块工作但 youtube 视频在背景中仍然可见时。

包含嵌入视频的 html 代码

<iframe width="344" height="229" src="http://www.youtube.com/embed/o6qNGUAciB4" frameborder="0" allowfullscreen=""/>

和javascript代码

<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="<?=$this->session->CI->config->config['js_path'];?>/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox -->
<link rel="stylesheet" href="<?=$this->session->CI->config->config['css_path'];?>/jquery.fancybox.css?v=2.1.1" type="text/css" media="screen" />
<script type="text/javascript" src="<?=$this->session->CI->config->config['js_path'];?>/jquery.fancybox.pack.js?v=2.1.1"></script>

<!-- Optionally add helpers - button, thumbnail and/or media -->
<link rel="stylesheet" href="<?=$this->session->CI->config->config['css_path'];?>/jquery.fancybox-buttons.css?v=1.0.4" type="text/css" media="screen" />
<script type="text/javascript" src="<?=$this->session->CI->config->config['js_path'];?>/jquery.fancybox-buttons.js?v=1.0.4"></script>
<script type="text/javascript" src="<?=$this->session->CI->config->config['js_path'];?>/jquery.fancybox-media.js?v=1.0.4"></script>

<link rel="stylesheet" href="<?=$this->session->CI->config->config['css_path'];?>/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="<?=$this->session->CI->config->config['js_path'];?>/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<script type="text/javascript">
var j= jQuery.noConflict();
j(document).ready(function() {
    j(".fancybox").fancybox({
        maxWidth    : 800,
        maxHeight   : 600,
        fitToView   : false,
        width       : '70%',
        height      : '70%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none',
        helpers : { 
               overlay: {
                opacity: 1, // or the opacity you want 
                css: {background: 'white'} // or your preferred hex color value
               } // overlay 
              } // helpers
    });
});
</script>
4

1 回答 1

1

添加womde=opaque到您的 youtube 链接 ( src) 中,例如:

<iframe width="344" height="229" src="http://www.youtube.com/embed/o6qNGUAciB4?wmode=opaque" frameborder="0" allowfullscreen=""></iframe>

(顺便说一句:我个人更喜欢处理链接而不是文本代码,因为我可以使用调试工具来帮助找到文本代码可能无法显示的其他可能问题;)

于 2012-10-14T21:02:54.583 回答