Return to Snippet

Revision: 39371
at January 17, 2011 04:08 by dropthenerd


Updated Code
$(document).ready(function(){
	$('a[href*="youtube.com/watch"]').click(function() {

	$.fancybox({
		'padding'		: 0,
		'autoScale'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: this.title,
		'width'			: 680,
		'height'		: 495,
		'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'type'			: 'swf',
		'swf'			: {
			'wmode': 'transparent',
			'allowfullscreen':	'true'
		}
	});

	return false;
	});

});

Revision: 39370
at January 17, 2011 03:47 by dropthenerd


Initial Code
$(document).ready(function(){
	$('a[href*="youtube.com/watch"]').click(function() {

	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'		: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

	return false;
	});

});

Initial URL
http://www.dropthenerd.com/how-to-show-youtube-videos-in-a-lightbox/

Initial Description

                                

Initial Title
Opening YouTube videos in a lightbox.

Initial Tags
video, jquery

Initial Language
jQuery