Fix YouTube iFrame Overlay and Z-Index Issues


/ Published in: jQuery
Save to your folder(s)

fix youtube iframe overlay


Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2. $("iframe").each(function(){
  3. var ifr_source = $(this).attr('src');
  4. var wmode = "wmode=transparent";
  5. if(ifr_source.indexOf('?') != -1) {
  6. var getQString = ifr_source.split('?');
  7. var oldString = getQString[1];
  8. var newString = getQString[0];
  9. $(this).attr('src',newString+'?'+wmode+'&'+oldString);
  10. }
  11. else $(this).attr('src',ifr_source+'?'+wmode);
  12. });
  13. });

URL: http://maxmorgandesign.com/fix_youtube_iframe_overlay_and_z_index_issues/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.