【发布时间】:2014-06-18 16:48:49
【问题描述】:
好的,所以我最近了解到 Verimatrix 的 ViewRight 网络播放器是一个所谓的 NPAPI 插件,可以使用涉及“虚拟 iframe”的技术覆盖 HTML 元素。
Div on top of ViewRight-player
现在,据我所知,Silverlight 似乎也是一个 NPAPI 插件(我可能弄错了)。因此,我尝试使用相同的方法在 iframe 中加载的另一个网站的 Silverlight 网络播放器顶部显示 DIV。
不幸的是,它不起作用...一旦 Silverlight 播放器加载,它就位于其他所有内容之上。 我知道在播放器中将无窗口参数设置为 true 可以解决它。但由于播放器不是由我托管,我无法编辑任何对象参数。
这是一个基于“dummy 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>
我希望有人可以帮助我完成这项工作:-)
谢谢
【问题讨论】:
标签: javascript jquery html css silverlight