在FancyBox中加载JW Player

伙计们,我觉得我很亲密,但没有奖品。 这是我用来加载Fancybox的代码,我试图通过它加载JW Player。

 jQuery(window).load(function() { jQuery("a.fancybox").fancybox({ 'content':'
Test
', maxWidth : 800, maxHeight : 600, fitToView : false, width : '70%', height : '70%', autoSize : false, closeClick : false, openEffect : 'none', closeEffect : 'none', afterLoad: function() { jwplayer('mediaspace').setup({ 'flashplayer': '/lib/jw/player.swf', 'file': 'LtGoBZ4D4_E', 'image': 'http://sofzh.miximages.com/jquery/0.jpg', 'provider': 'youtube', 'height': 400, 'width': 700, 'controlbar.position': 'bottom', 'youtube.quality': 'highres' }); } }); });

请原谅代码格式化,我一直在尝试很多不同的选项。

JW Player在fancybox之外工作。 任何想法或其他方式来看问题?

afterLoad回调不会触发,因为没有需要“加载”的fancybox插件固有的图像或video。 代替:

  afterLoad: function() { 

使用:

  afterShow: function() { 

这将解决您的问题。

以下是文档的链接,以供进一步参考或未来的API更改: http : //fancyapps.com/fancybox/