Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Wordpress colorbox youtube
$('a[href^=""]').colorbox({iframe:true, innerWidth:640, innerHeight:390, maxWidth:'95%', maxHeight:'95%', href:function(){
var videoId = new RegExp('[\\?&]v=([^&#]*)').exec(this.href);
if (videoId && videoId[1]) {
return ''+videoId[1]+'?rel=0&wmode=transparent&autoplay=1';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment