Fancybox minimum does not work for video properly?

一世执手 提交于 2020-01-16 12:10:24

问题


When using fancybox with an overlay, I seem to have issues with the jQuery working?

View it at mg.hejmej.com/index.html (2nd box from the left)


回答1:


Since you are targeting your youtube videos via embed mode

http://www.youtube.com/embed/HGVTaIlzocM

then you need the proper fancybox script using 'type':'iframe':

$("a.fancybox-vidz").fancybox({
            'padding'       : 0,
            'autoScale'     : false,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'title'         : this.title,
            'width'         : 680,
            'height'        : 495,
            'type'          : 'iframe',
});

You may optimize your link to autoplay and to position itlself behind the fancybox close button like

<a href="http://www.youtube.com/embed/HGVTaIlzocM?autoplay=1&amp;wmode=opaque" title="Have a blast at Max's Golf Centre!" class="fancybox-vidz"><img alt="Photo" src="images/h3.jpg" class="fade" style="opacity: 1;"></a>


来源:https://stackoverflow.com/questions/9337332/fancybox-minimum-does-not-work-for-video-properly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!