I'm trying to make a YouTube video that is embedded as an iframe pop up in a modal window. I have it successfully working in Chrome and Firefox, but it will not work in IE. The Flash video seems to override the z-index, even though I have the wmode set to transparent (I've also tried opaque with the same results). Menus that pop over the video work correctly, but a div with an onclick event positioned directly over the video is not working. I've tried setting the z-index on just about every element manually, with no change.
I've included an HTML page that demonstrates the issue. On Chrome and Firefox if you click on the video, you will get an alert with a message of 'clicked', but this doesn't happen in IE.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type='text/javascript'>
$(function(){
$("ul.dropdown li").hover(function(){
$(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible');
}, function(){
$(this).removeClass("hover");
$('ul:first',this).css('visibility', 'hidden');
});
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" » ");
});
</script>
<style type="text/css">
* { margin: 0; padding: 0; }
body { font: 14px Helvetica, Sans-Serif; }
#page-wrap { width: 800px; margin: 80px auto; }
a { text-decoration: none; }
ul { list-style: none; }
p { margin: 15px 0; }
/*
LEVEL ONE
*/
ul.dropdown { position: relative; }
ul.dropdown li { font-weight: bold; float: left; zoom: 1; background: #ccc; }
ul.dropdown a:hover { color: #000; }
ul.dropdown a:active { color: #ffa500; }
ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333;
color: #222; }
ul.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */
ul.dropdown li.hover,
ul.dropdown li:hover { background: #F3D673; color: black; position: relative; }
ul.dropdown li.hover a { color: black; }
/*
LEVEL TWO
*/
ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000;
border-bottom: 1px solid #ccc; float: none; }
/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }
/*
LEVEL THREE
*/
ul.dropdown ul ul { left: 100%; top: 0; }
ul.dropdown li:hover > ul { visibility: visible; }
</style>
<title>IE Bug</title>
</head>
<body>
<div class="page-wrapper">
<div class="menu">
<ul class="dropdown" style="z-index: 100;">
<li>
<a href="#">Menu</a>
<ul class="sub_menu">
<li><a href="#">Sub Item 1</a></li>
<li><a href="#">Sub Item 2</a></li>
</ul>
</li>
</ul>
</div>
<br />
<div class="span4" style="background-color: transparent; display: block; margin-bottom: 0px; margin-left: 20px; margin-right: 0px; margin-top: 0px; width: 300px; z-index: 4;">
<div class="column" style="margin-left: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; z-index: 3;">
<div class="embedded-video" style="position: relative; z-index: 3;">
<div class="video-launcher" onclick="alert('clicked');" style="position: absolute; cursor: pointer; width: 100%; height: 100%; z-index: 2;"></div>
<div class="youtube-video" style="z-index: 1;">
<iframe style="z-index: 1;" width="300" height="225" src="http://www.youtube.com/embed/W8_Kfjo3VjU?rel=0&showinfo=0&wmode=transparent" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</div>
</body>
I've search all over trying to resolve this, but all I can find is information about setting the wmode and the z-index. There must be something else I'm missing, or maybe this just won't work in IE. Thanks for the help.