IE中的CSS()具有Z-Index和Visibility

时间:2014-01-27 19:13:10

标签: jquery css internet-explorer jplayer

所以这是我的基本结构。它在IE中不起作用,有什么建议吗? IE无法正常使用jPlayer状态吗?

 <div id="videodiv">
     <img src="poster.jpg">
     <div id="video">jPLayer stuff here</div>
     <button></button>
</div>

<style>
#videodiv{position:relative;}
img{z-index: 30; visibility:visible; position:relative;}
#video{z-index: 25; position:absolute; top:0px;}
button{z-index: 40; position:absolute;}
</style>

<script>
play: function (event) {
$parent.find('img.poster').css("z-index", "20");
$parent.find('img.poster').css("visibility", "hidden");
}
</script>

1 个答案:

答案 0 :(得分:2)

为了使z-index值工作,您需要为position:relative之类的元素设置非静态位置。试试这个:

img {
   position:relative;
   z-index: 30; 
   visibility:visible;
}
#video {
   position:relative; 
   z-index: 25;
}
button { 
   position:relative;
   z-index: 20;
}