javascript - 拼图 : different domain iframe needs to dynamically "overlap" parent content

标签 javascript css iframe cross-domain

对于 Stack Overflow 天才来说,这应该是一个有趣的谜题:

我正在构建一个将注入(inject) div 的浏览器插件, script , 和 iframe到客户正在查看的任何页面的标记中。目的是将工具栏锚定到每个页面的底部(StumbleUpon 为 Chrome 执行此操作)。这是放在 </body> 之前的代码:

<div id="someID1" style="position: fixed; bottom: 0px; left: 0px; width: 100%; height: 100%; background-color: transparent;">
    <iframe id="someID2" src="http://www.example.com/iframeContent.html" frameBorder="0" scrolling="no" style="background-color: transparent; margin: 0px; height: 100%; width: 100%; padding: 0px;"/>
</div>

此工具栏 ( iframe ) 将托管在我们的服务器上并具有弹出式面板。当用户单击打开菜单时,菜单会垂直扩展工具栏(例如,工具栏高度为 35 像素;带面板的高度为 100 像素)。

我可以在 Safari、Firefox 和 Chrome 中实现这一点,方法是让我的工具栏位于透明背景上的所有内容之上(即 height: 100%background-color: transparent 代表 diviframe)。但这不适用于 IE7、IE8、IE9。

我试过 (1) 做 background: blank.gif而不是背景颜色:透明,和(2)注入(inject) script进入具有调整大小功能的父级,我可以使用 parent.resizeFunction(height) 调用它(“资源被拒绝”)

关于如何解决这个问题的任何想法?非常感谢!

最佳答案

我要运行所以没法测试,不过IE好像听的不规范ALLOWTRANSPARENCY属性(property)。

When the property is set to false, the backgroundColor property of the object can only be that of the window. When the property is set to true, the backgroundColor property of the object can be set to any value, including the default value of transparent.

关于javascript - 拼图 : different domain iframe needs to dynamically "overlap" parent content,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4171766/

相关文章:

JavaScript - 将数组中的每 3 个项目包装到一个 div 中

JavaScript 循环性能 - 为什么将迭代器递减到 0 比递增更快

JavaScript:加载空 iframe 时获取通知

javascript - 是否有将 HTML5、CSS3 和 JavaScript 捆绑到 native 移动应用程序中的平台?

html - 如何使用CSS 3和html5制作响应式固定 header

css - 如何让iframe在主窗口水平滚动时改变位置

javascript - MTurk 上的 jQuery,为什么 Chrome 报告 "Unsafe JavaScript attempt to access frame with URL"?

javascript - 是否可以提前改变任何对象方法的行为?

javascript - 通过 Ajax 成功回调更新可观察数组时启用绑定(bind)中断

html - Safari text-input 渲染输入框下方的文字