Safari 及其他平台上的 Java Applet z-index
网页中 Java Applet 的一个众所周知的问题是,浏览器会忽略 Applet 标记与页面中其他组件的 z 索引。 无论您如何在页面中定位元素和 z-index 元素,小程序都会将自己绘制在所有内容之上。
有一种解决方法,称为 iframe shim,如下所述: http://www.oratransplant.nl/2007/10/26/using-iframe-shim-to-partly-cover-a-java-applet/ 。
但是,此解决方法在 Windows 中的 Safari 3 或 4 中不起作用(假设 Mac 也是如此)。
有谁知道如何让它在 Safari 中工作?
有人知道如何迫使 Sun 解决根本问题,从而避免笨拙的垫片吗? 这是有关该问题的错误报告,https://bugs.java.com/bugdatabase /view_bug?bug_id=6646289,请注意,它已经开放一年了,但是其他错误报告可以追溯到很多年前。
这太令人沮丧了,难道 Sun 不明白正是这种情况使 Java 被边缘化,成为在浏览器中做很酷的事情的一种方式吗? 我爱你Java,但你并没有帮助你的情况......
A well known problem with Java Applets in webpages is that browsers ignore the z-index of the applet tag vs. other components in the page. No matter how you position and z-index elements in the page, applets will draw themselves on top of everything.
There is a workaround, known as the iframe shim, as described here: http://www.oratransplant.nl/2007/10/26/using-iframe-shim-to-partly-cover-a-java-applet/.
However, this workaround does not work in Safari 3 or 4 in Windows (assuming the same for Mac).
Does anyone know a way to make it work in Safari?
Does anyone have ideas about how to pressure Sun to fix the underlying problem so we can avoid clumsy shims? Here is a bug report on the issue, https://bugs.java.com/bugdatabase/view_bug?bug_id=6646289, notice that it has been open for a year, however other bug reports go back many many years.
This is so frustrating, don't Sun understand that this is the very sort of thing that has marginalized Java as a way of doing cool stuff in the browser? I love you Java, but you are not helping your situation...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个问题有一个棘手的解决方案。 没有必要将代码放在
iframe
中。 我们可以有一个虚拟的iframe
,就像小程序上面的一层。 然后,可以轻松地将带有文本的绝对 div 放置在该iframe
之上。工作示例
There is a tricky solution for the problem. It's not necessary to have the code inside an
iframe
. We can have a dummyiframe
just as a layer above the applet. And then an absolute div with the text can easily placed above thatiframe
.working example
实际上问题与 z-index 根本无关。 这是由 Netscape Plugin API (NPAPI) 的“窗口化”绘图模型引起的。
你对此无能为力(除了垫片)。 插件作者必须使用无窗口 API 重写它< /a>.
Actually problem is not related to z-index at all. It's caused by "windowed" drawing model of Netscape Plugin API (NPAPI).
You can't do anything about it (except the shim). Plugin author has to rewrite it using windowless API.
其一,Mac 上的 Java 实际上是由 Apple 而不是 Sun 构建的。 至于小程序,当小程序上面出现东西时,我们会隐藏小程序。 但这可能不足以满足您的需求。
For one, Java on Mac is actually built by Apple and not Sun. As for the applets, we hide the applets when there is something appearing on top of it. That might not suffice for your needs though.