Posted By

kiroweb on 10/25/11


Tagged

iframe jquery z-index wmode


Versions (?)

Fix YouTube iFrame Overlay and Z-Index Issues


 / Published in: jQuery
 

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

fix youtube iframe overlay

  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. });

Report this snippet  

You need to login to post a comment.