Skip to content

Instantly share code, notes, and snippets.

@BenRichter
Created July 10, 2014 08:32
Show Gist options
  • Save BenRichter/6c0b4eabebf4d3add003 to your computer and use it in GitHub Desktop.
Save BenRichter/6c0b4eabebf4d3add003 to your computer and use it in GitHub Desktop.
IE iframe z-index fix (z.B. Youtube)
jQuery(function ($) {
/**
*
* IE iframe fix z-index
*
**/
function ieIframeFix(){
$("iframe").each(function () {
var ifr_source = $(this).attr('src');
var wmode = "wmode=transparent";
if (ifr_source.indexOf('?') != -1) $(this).attr('src', ifr_source + '&' + wmode);
else $(this).attr('src', ifr_source + '?' + wmode);
});
}
$(document).ready(function () {
ieIframeFix();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment