Can you explain the parameters of $ .fancybox.open ([group], [options]), and if I can add the youtube link as href?

I am reading the documentation:

http://fancyapps.com/fancybox/#docs

and $ .fancybox.open ([group], [options]) and the open explanation is good, but I wonder if I can use the youtube video link in the groups array? I am trying to play a youtube video after dom is ready, for example:

http://jsfiddle.net/STgGM/

$.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 }); 

I can make my video appear in fancybox, which is great, but I want it to appear after the page loads automatically, without having to click on the link, for example, fancybox in the jsfiddle example above with .open.

Thanks for your help in advance.

+4
source share
1 answer

Have you tried to do this yet?

 $(function () { $.fancybox.open([ { type: 'iframe', href : 'http://www.youtube.com/embed/L9szn1QQfas?autoplay=1&wmode=opaque', title : '1st title' } ], { padding : 0 }); }); 

Working example: http://jsfiddle.net/NDM5F/

+12
source

All Articles