Created
August 20, 2012 20:51
-
-
Save ghaida/3407798 to your computer and use it in GitHub Desktop.
Fix embedded Youtube Video z-index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Source: http://alteredadvice.com/youtube-iframe-videos-overlay-menu-dropdowns-z-index-problem/ | |
| $(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); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment