Created
March 9, 2012 18:01
-
-
Save nicolechung/2007781 to your computer and use it in GitHub Desktop.
Fancybox: youtube (regular link)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#fancybox-youtube-link").click(function(e) { | |
e.preventDefault(); | |
var url = $(this).attr('href'); | |
$.fancybox({ | |
'width': 660, | |
'height': 380, | |
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), | |
'type': 'iframe' // see this? | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment