2013-03-06 38 views
4

我有以下的HTMLHTML DIV不来embed`对象的'顶 - IE

<embed class='pdf_container' src='welcome.pdf' style ='width:100%;height:500px;' ></embed> 

<div id="show_message" class='message_wrapper' > 

<div id="message_content"> The requested operation ... </div> 

</div> 

和CSS

.message_wrapper{ 
    position:fixed; 
    z-index:1000; 
    height:100px; 
    width:100%; 
    background:red; 
    top:0; 
    left:0; 
} 
.pdf_container{ 
    position:absolute; 
    top:0; 
    left:0; 
    z-index:100; 
} 

其实我想展示#show_message.pdf_container,它在Firefox中运行良好,但不在IE中,它忽略了z-index

请帮我弄清楚这个问题。

谢谢。

见截图:

在IE

IN IE 8,9

和FF

IN FIREFOX

+0

其工作中即罚款,以及...这也就是乌尔谈论 – supersaiyan 2013-03-06 09:38:24

+0

请注明IE版本 – Sreekumar 2013-03-06 09:44:14

+0

遗憾的是它并不在IE的任何版本的工作(或至少IE8,9) – rafiq 2013-03-06 09:48:12

回答

-1

您需要WMODE设置为透明EMBE内d标签。

<embed class='pdf_container' src='welcome.pdf' style ='width:100%;height:500px;' wmode="transparent" ></embed> 
+0

'wmode'将不会在这种情况下工作。 – Red 2013-03-06 12:20:27

-1

试试这个,你切切实实得到解决,像我一样,其工作罚款我的本地系统:-) cheerss 小不同势形成你的代码,但我相信你会得到它。

http://jsfiddle.net/fRsUv/

html { height:100% } 

#container { 
    position:relative; 
    width:100%; 
} 

#pdf { 
    width:100%; 
    z-index:1; 
} 

#layer_over_pdf { 
    width:200px; 
    z-index:2; 
} 

#pdf, #layer_over_pdf { 
    position:absolute; 
    top:0; 
    left:0; 
} 



<div id="container"> 
<div id="pdf"><embed id="pdfEmbed" src="JavaScript_DHTML_Mat_V4.pdf" style="width:500px; height:600px" type="application/pdf"></embed></div> 
<div id="layer_over_pdf">some content</div> 
</div> 
+0

不幸的是,它不能在IE上工作,PDF显示在页面的顶部。 – rafiq 2013-03-06 11:01:07