NetScape浮动层的焦点问题

作者:Hily 原始链接:http://hily.me/blog/2005/03/netscape-layer-focus/
版权声明:可以转载,转载时务必以超链接形式标明文章原始出处作者信息版权声明

我使用的是NetScape 7.0,当页面中包含一个文本域<textarea>和一个浮动层<div>时,会发生如下问题:

当<textarea>出现在<div>之前时,能正常把焦点移动到<div>上,而当<textarea>出现在<div>之后时,则无法把焦点移动到<div>上。

以下是测试<textarea>出现在<div>之后的代码,把<textarea>移动到<div>前以后就可以正常点击<div>中的按钮了:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-CN" />
<title> Why? </title>
<style type="text/css">
<!--

 #ddd {
  font-size: 12px;
  border: 1px solid #000000;
  position: absolute;
  top: 100px;
  left: 100px;
  visibility: hidden;
  background-color: #EBE9ED;
  padding: 10px;
  width: 70px;
  height: 20px;
 }
-->
</style>
</head>

<body>
<p>
<input type="button" value="显示" onclick="getElementById('ddd').style.visibility='visible';">
<input type="button" value="隐藏" onclick="getElementById('ddd').style.visibility='hidden';">
</p>

<div id="ddd">
<input type="button" value=" 关 闭 ">
</div>

<textarea id="lyrics" rows="10" cols="70"></textarea>

</body>
</html> 

-- EOF --

发表一下您的高见

If you have any question, or for the language problem, please fell free to leave a comment or just contact me with email: hilyjiang [At] Gmail.