Fix YouTube and iframe Z-Index overlay problem
Description
Sometimes YouTube Videos overlay certain divs. This code will fix the issue. Just place this code above the header tag of the site and the YouTube videos will no longer overlay
Sometimes YouTube Videos overlay certain divs. This code will fix the issue. Just place this code above the header tag of the site and the YouTube videos will no longer overlay
JavaScript Code
<script type="text/javascript">
$(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);
});
});
</script>