Skip to content

Instantly share code, notes, and snippets.

@ghaida
Created August 20, 2012 20:51
Show Gist options
  • Select an option

  • Save ghaida/3407798 to your computer and use it in GitHub Desktop.

Select an option

Save ghaida/3407798 to your computer and use it in GitHub Desktop.
Fix embedded Youtube Video z-index
//Source: http://alteredadvice.com/youtube-iframe-videos-overlay-menu-dropdowns-z-index-problem/
$(document).ready(function() {
$("iframe").each(function(){
var ifr_source = $(this).attr('src');
var wmode = "wmode=transparent";
if(ifr_source.indexOf('?') != -1) {
var getQString = ifr_source.split('?');
var oldString = getQString[1];
var newString = getQString[0];
$(this).attr('src',newString+'?'+wmode+'&'+oldString);
}
else $(this).attr('src',ifr_source+'?'+wmode);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment