2012-02-18 19 views

回答

0

既然你是通過embed模式針對您的YouTube視頻

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

,那麼你需要正確的fancybox腳本中使用'type':'iframe'

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

您可以優化您的鏈接自動播放和itlself定位的fancybox關閉按鈕像背後

<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>