Created
March 2, 2015 10:55
-
-
Save andreascarpello/e1a4c036603ae1c936e5 to your computer and use it in GitHub Desktop.
YouTube Video Embedded via iframe Ignoring z-index and cover html elements Flash Object And Z-Index: How To Make Them Play Nicely Together
YouTube video content covering CSS drop down menus in IE < 9
This file contains 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
/** | |
* Flash videos issue on IE: | |
* http://stackoverflow.com/questions/9074365/youtube-video-embedded-via-iframe-ignoring-z-index | |
* http://stackoverflow.com/questions/7747133/youtube-video-content-covering-css-drop-down-menus-in-ie-9 | |
*/ | |
//Fix z-index youtube video embedding | |
$('iframe').each(function() { | |
var url = $(this).attr("src"); | |
if ($(this).attr("src").indexOf("?") > 0) { | |
$(this).attr({ | |
"src" : url + "&wmode=transparent", | |
"wmode" : "Opaque" | |
}); | |
} | |
else { | |
$(this).attr({ | |
"src" : url + "?wmode=transparent", | |
"wmode" : "Opaque" | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment