Div在iframe的顶部,里面有Silverlight

Div on top of iframe with Silverlight inside

本文关键字:Silverlight 顶部 iframe Div      更新时间:2023-09-26

我最近了解到Verimatrix的ViewRight网络播放器是一个所谓的NPAPI插件,它可以使用一种涉及"虚拟iframe"的技术来覆盖HTML元素。

在viewwright -player上设置Div

HTML在NPAPI插件之上

现在,据我所知,Silverlight似乎也是一个NPAPI插件(我可能搞错了)。所以我尝试了同样的方法来显示一个DIV从另一个网站加载在iframe的Silverlight web播放器的顶部。

不幸的是它不起作用…一旦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>

我希望有人能帮我做这件事:-)

Thx

为您删除的问题PHP:从HTML中获取特定标签的属性值[duplicate]你在

里漏了一个S
document.getElementsByClassName('classname')

,然后你可以

.
.
$attr = $tag->item(15);
$percent = $tag.style.heigth
http://www.w3schools.com/jsref/prop_style_height.asp