问题
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&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