代码之家  ›  专栏  ›  技术社区  ›  Erbert

彩色盒子中的多个视频?第一次加载但其他加载失败

  •  1
  • Erbert  · 技术社区  · 12 年前

    我使用Colorbox“rel函数”在1个灯箱中显示本地图像和youTube视频的混合,我已经在一定程度上实现了这一点。问题是我需要插入多个视频,但当我插入时,我无法在显示“请求失败:错误”的颜色框中加载多个视频。我已经将视频设置为以设置的宽度和高度显示在iframe中,无法理解为什么1有效但不超过1。(如果我改变他们显示的顺序,首先显示的总是显示,但没有其他视频,所以我知道源视频是可以的。

    这是我的代码:

    <script>
        jQuery(document).ready(function () {
            jQuery('a.gallery1').colorbox({ rel:'group1' });
            jQuery('a.gallery2').colorbox({ rel:'group2' });
            jQuery('a.gallery3').colorbox({ rel:'group3' });
            jQuery('a.gallery4').colorbox({ rel:'group4' });
            jQuery('a.gallery5').colorbox({ rel:'group5' });
            jQuery('a.gallery6').colorbox({ rel:'group6' });
            jQuery('a.gallery7').colorbox({ rel:'group7' });
            jQuery('a.gallery8').colorbox({ rel:'group8' });
            jQuery('a.gallery9').colorbox({ rel:'group9' });
            jQuery('a.gallery10').colorbox({ rel:'group10' });
            jQuery('#video').colorbox({iframe:true, innerWidth:493, innerHeight:370});
    
        }); 
    </script>
    
    <a class="gallery1" href="images/content/cosmos1Full.jpg" title="Salvatore Arancio, title of work, year">
                        <img src="images/content/cosmos1.jpg"  alt="cosmos1" width="484" height="370" />
                        <a class="gallery1" href="images/content/ohoopee2.jpg" title="Salvatore Arancio, title of work, year">
                        <a class="gallery1" href="images/content/ohoopee3.jpg" title="Salvatore Arancio, title of work, year">
                        <a class='gallery1' href="http://vimeo.com/moogaloop.swf?clip_id=29956704&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1&" title="Ed Atkins, 'Death Mask 3', 2011. Extract." id="video">
                        <a class='gallery1' href="http://www.youtube.com/v/rhCssm8BMNM?version=3" title="A Tumour (Ed Atkins)" id="video"></a>
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Jack    12 年前

    我的猜测是,您正在重用视频id,尽管HTML规范要求id是唯一的。如果您计划将其应用于多个元素,请将其更改为类。