【问题标题】:Div on top of iframe with Silverlight inside位于 iframe 顶部的 Div,内部有 Silverlight
【发布时间】:2014-06-18 16:48:49
【问题描述】:

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

Div on top of ViewRight-player

HTML on top of NPAPI plugin

现在,据我所知,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


    【解决方案1】:

    对于您已删除的问题 PHP:从 HTML 中获取特定标签的属性值 [重复] 你在

    中错过了一个 S
    document.getElementsByClassName('classname')
    

    然后你就可以了

    .
    .
    $attr = $tag->item(15);
    $percent = $tag.style.heigth
    

    http://www.w3schools.com/jsref/prop_style_height.asp

    【讨论】:

    • 我希望我的问题没有被删除 :-) 感谢您的建议,但据我所知,您指的是 JavaScript 的 getElementsByClassName,我不相信它可以在 PHP 中使用。 style.height 也是如此;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-29
    • 1970-01-01
    • 1970-01-01
    • 2013-09-12
    • 1970-01-01
    相关资源
    最近更新 更多