Time for action – showing a video in a lightbox
Follow these steps to set up Colorbox to play a set of videos:
- We'll get started as we usually do, by setting up a basic HTML file and associated files and folders, just like we did in Chapter 1, Designer, Meet jQuery. In the body of our HTML document, we're going to include a link to a YouTube video:
<p><a href="http://www.youtube.com/embed/2_HXUhShhmY?autoplay=1" id="video-link">Watch the video</a></p>
Note a couple of things about my video link. First, I'm using the embed URL for the video rather than the link to YouTube's video page. For users without JavaScript enabled, this will take them to a stand-alone video player page on YouTube's site. For users with JavaScript enabled, it will ensure that ...
Get jQuery for Designers Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.