您能解释$ .fancybox.open([group],[options])参数吗?是否可以将YouTube链接添加为href? [英] Can you explain $.fancybox.open( [group], [options] ) params and if I can add youtube link as href?
问题描述
我正在阅读文档:
http://fancyapps.com/fancybox/#docs
和$ .fancybox.open([group],[options])和打开说明都很好,但是我想知道是否可以使用组数组中指向youtube视频的链接吗?像这样的dom准备好后,我正在尝试播放youtube视频:
and the $.fancybox.open( [group], [options] ) and open explanation is good, but I'm wondering if I can use a link to a youtube video in the group array? I'm attempting to play a youtube video after the dom is ready such as this:
$.fancybox.open([
{
href : 'http://fancyapps.com/fancybox/demo/1_b.jpg',
title : '1st title'
},
{
href : 'http://fancyapps.com/fancybox/demo/2_b.jpg',
title : '2nd title'
}
], {
padding : 0
});
我能够使我的视频出现在fancybox中,这很棒,但是我希望它在页面自动加载后出现,而无需单击链接,例如上面的jsfiddle示例中的fancybox那样使用.open.
I am able to get my video to appear in a fancybox, which is great, but I want it to appear after the page loads automatically without the need to click on a link, such as the fancybox does in the jsfiddle example above with .open.
谢谢您的所有帮助.
推荐答案
您是否尝试过这样做?
$(function () {
$.fancybox.open([
{
type: 'iframe',
href : 'http://www.youtube.com/embed/L9szn1QQfas?autoplay=1&wmode=opaque',
title : '1st title'
}
], {
padding : 0
});
});
工作示例: http://jsfiddle.net/NDM5F/
这篇关于您能解释$ .fancybox.open([group],[options])参数吗?是否可以将YouTube链接添加为href?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!