好的,所以我最近才知道Verimatrix的ViewRight網絡播放器是一種所謂的NPAPI插件,可以使用涉及「虛擬iframe」的技術來覆蓋HTML元素。Div內置於Silverlight內部的iframe
Div on top of ViewRight-player
現在,據我已經能夠收集,Silverlight的似乎是一個NPAPI插件,以及(我可能會誤)。所以我嘗試了同樣的方法在一個iframe中加載的另一個網站上的Silverlight Web Player上顯示DIV。
不幸的是,它不起作用...只要Silverlight播放器加載它,它就位於其他所有東西之上。 我知道在播放器中將無窗口參數設置爲true會解決它。但由於玩家不在我身邊,我無法編輯任何對象參數。
下面是基於 「虛擬IFRAME」 方法的測試場景:http://jsfiddle.net/c7Hsp/
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
background: black;
cursor: auto;
-webkit-user-select: none;
user-select: none;
overflow: hidden;
}
:::-webkit-scrollbar {
display: none;
}
.wrapperDiv {
position: absolute;
bottom: 200px;
left: 200px;
width: 200px;
height: 200px;
margin: 0 auto;
}
.dummyFrame {
position: absolute;
top: 200px;
left: 200px;
width: 200px;
height: 200px;
background-color: red;
}
.contentDiv {
position: absolute;
top: 25px;
left: 25px;
width: 300px;
color: white;
font-family: Arial;
font-size: 18pt;
text-align: center;
background-color: green;
}
#silverFrame {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
border: 0px;
background: transparent;
}
</style>
</head>
<body>
<iframe id="silverFrame" src="http://clubace.dk/silverlight.htm"></iframe>
<div class="wrapperDiv">
<iframe class="dummyFrame" frameborder="0"></iframe>
<div class="contentDiv">Weee!<br>I'm overlaying this<br>NPAPI plugin :D</div>
</div>
</body>
</html>
我希望有人能幫助我,使這項工作:-)
THX
我希望我的問題是不會被刪除:-) 感謝的建議,但據我可以看到你指的是JavaScript的getElementsByClassName方法,我不相信可以在PHP中使用。 style.height事物也是如此;-) – Ace