【问题标题】:Java Applet z-index on Safari and beyondSafari 及其他平台上的 Java Applet z-index
【发布时间】:2013-11-15 13:25:10
【问题描述】:
【问题讨论】:
标签:
java
html
applet
overlay
z-index
【解决方案1】:
这个问题有一个棘手的解决方案。不必将代码放在iframe 中。我们可以有一个虚拟的iframe 作为小程序上方的一层。然后可以轻松地将带有文本的绝对 div 放在 iframe 上方。
工作示例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Applet z index issue</title>
<style>
.applet {width:400px; margin:0 auto; text-align:center; border:1px solid #000; left:40%; position:absolute }
.iframe {width:400px; background:#fff; position:absolute; border:1px solid #f00; position:absolute; left:45%; top:20px; z-index:9; height:201px;}
.message { width:250px; border:1px solid #000; background:#fff; height:150px; color:#fff; text-align:center; z-index:99; background:#555; float:left; position:absolute; left:45%; top:20px}
</style>
</head>
<body>
<div class="message">Message</div>
<div class="iframe"><iframe style="width:500px; height:205px; background:none; border:none"> </iframe></div>
<div class="applet">
<applet code="Bubbles.class" width="400" height="350">
Java applet that draws animated bubbles.
</applet>
</div>
</body>
</html>
【解决方案3】:
首先,Mac 上的 Java 实际上是由 Apple 而不是 Sun 构建的。至于小程序,当有东西出现在它上面时,我们隐藏小程序。不过,这可能不足以满足您的需求。