Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Fancybox视频库_Javascript_Jquery_Html_Iframe_Fancybox - Fatal编程技术网

Javascript Fancybox视频库

Javascript Fancybox视频库,javascript,jquery,html,iframe,fancybox,Javascript,Jquery,Html,Iframe,Fancybox,我正在尝试使用我为图像库找到的一些教程,用fancybox制作一个视频库,但我不确定这是否是我想要的。我所拥有的只是一个图标,它显示一个fancybox,其中包含我想要将视频容器转换为视频库的所有iFrame 这是我的HTML: <a id="videoIcon" href="#video" class="fancybox"> <img src="http://megaicons.net/static/img/icons_sizes/8/178/512/photo-vi

我正在尝试使用我为图像库找到的一些教程,用fancybox制作一个视频库,但我不确定这是否是我想要的。我所拥有的只是一个图标,它显示一个fancybox,其中包含我想要将视频容器转换为视频库的所有iFrame

这是我的HTML:

<a id="videoIcon" href="#video" class="fancybox">
    <img src="http://megaicons.net/static/img/icons_sizes/8/178/512/photo-video-start-icon.png" width="33" height="33">
</a>

<div id="video" style="display: none;" data-fancybox-group="gallery">
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2plsuh" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2pn6zo" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2pn66h" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2pjpvg" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2pn6wd" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2pn61r" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2p5add" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2or2yc" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
    <iframe class="fancybox_iframe" src="http://www.dailymotion.com/embed/video/x2of336" width="480" height="269" frameborder="0" allowfullscreen=""></iframe>
</div>
这里有一个

谢谢你,很抱歉我的英语不好

另外:iFrame是通过ajax调用获得的,并将响应放在带有handlebar.js的模板中,因此包含所有视频的div在开始时实际上是空的。然而,我认为这与解决方案无关

$(document).ready(function() {
    $("a#videoIcon").fancybox();
    $(".fancybox_iframe").fancybox({
        type : 'iframe'
    });
});