加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 如何在Chrome中显示Java applet

发布时间:2020-12-14 18:48:56 所属栏目:资源 来源:网络整理
导读:我在我的 HTML页面嵌入iframe元素: iframe src="applet.html" frameborder="0" style="width: 600px; height: 600px;"/iframe applet.html看起来像这样: htmlhead/headbody applet code="ClockApplet.class" width="100%" height="100%" /applet/body/html
我在我的 HTML页面嵌入iframe元素:
<iframe src="applet.html" frameborder="0" style="width: 600px; height: 600px;"></iframe>

applet.html看起来像这样:

<html>
<head>
</head>

<body>
    <applet code="ClockApplet.class" width="100%" height="100%">
    </applet>
</body>
</html>

问题是:如何在iframe中的Java小程序上显示一个div元素(位置:absolute).

我试图使用另一个iframe元素:

<html>
<head>

</head>
<body>
    <iframe src="applet.html" frameborder="0" style="width: 600px; height: 600px;"></iframe>

    <iframe src="javascript:false;" frameborder="0" style="position: absolute; top: 10px; left: 10px; width: 150px; height: 150px; z-index: 99"></iframe>
    <div style="position: absolute; top: 10px; left: 10px; background-color: gray; height: 150px; width: 150px; z-index: 100">Hello World</div>
</body>
</html>

在IE浏览器中可以正常工作,而不是Chrome.

解决方法

我发现一篇文章似乎提供了一个解决方案,所以我不会要求提供这样的信用:

http://www.oratransplant.nl/2007/10/26/using-iframe-shim-to-partly-cover-a-java-applet/

从文章:

The solution is to have a third Iframe
C within Iframe A. Iframe C has a
z-index within Iframe A that is higher
than the z-index of the Applet. It is
positioned so that it’s rectangle as
considered by the top page is
identical to that of the Iframe B
overlay.

我将第二个IFrame代码从主页粘贴到applet.html中,如下所示:

<iframe src="javascript:false;" frameborder="0" style="position: absolute; top: 10px; left: 10px; width: 150px; height: 150px; z-index: 1"></iframe>
<applet code="ClockApplet.class" width="100%" height="100%">
</applet>

而且它似乎是在Chrome中做的伎俩.

我确实获得了框架边框,但我猜这是可以固定的.搏一搏.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读