O'Reilly logo

Instant Fancybox by Kyle Diedrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying YouTube videos (Intermediate)

Now that we've covered the basic image functionality for Fancybox, let's load a video from YouTube. Fancybox makes it easy to load any YouTube video in a pop-up window.

Getting ready

To start things off, we need to find a video we want to display. Go to YouTube and pick any video you like. We need to find the embed URL that YouTube provides.

On the YouTube page, for the video you want to use, click on the Share tab as shown in the following screenshot:

Getting ready

Next, click on the Embed link. A box will show up with some HTML code for an iframe tag as shown in the following screenshot:

Note

Lastly, copy src of iframe. This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required