Skip to content

Instantly share code, notes, and snippets.

@ramzesimus
Created January 8, 2014 23:17
Show Gist options
  • Save ramzesimus/8326566 to your computer and use it in GitHub Desktop.
Save ramzesimus/8326566 to your computer and use it in GitHub Desktop.
function avia_iframe_fix(container)
{
var iframe = jQuery('iframe[src*="youtube.com"]', container),
youtubeEmbed = jQuery('iframe[src*="youtube.com"] object, iframe[src*="youtube.com"] embed', container).attr('wmode','opaque');
iframe.each(function()
{
var current = jQuery(this),
src = current.attr('src');
if(src)
{
if(src.indexOf('?') !== -1)
{
src += "&wmode=opaque";
}
else
{
src += "?wmode=opaque";
}
current.attr('src', src);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment