各位高手:
    我最近在做一个动态生成的下拉列表框,程序会根据用户在列表框1的选项来用javascript生成下拉列表框2。程序在IE/Firefox都运行正常,但在Safari3.0.3中就出现问题。问题是当动态生成列表框2时,列表框2的选项的某些区域会被黑色覆盖,详细请参考以下例子:
======================================================================================================
<html>
<head>
<title>Fail to repaint the dynamic options in dropdown menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body bgcolor="#FFFFFF">
<div align="center">
  <h2>Fail to repaint the dynamic options in dropdown menu</h2>
</div>
<h3 align="center">In Safari 3.0.3 (522.15.5) running on Windows XP </h3>
<p><b>Instructions:</b></p>
<ol>
  <li>Select the item2 in the List 1.</li>
  <li>Click on the List 2 to view the options.</li>
  <li>Select the item3 in the List 1.</li>
  <li>Click on the list2 again to view the items. There will be black all around the options.</li>
</ol><p>Email me at [email protected] for more information or to suggest possible solutions.</p>
<h3 align="left">
  <p>&nbsp;</p>
  <script language="JavaScript">
function refreshOptions(list, list1)
{
if (list.selectedIndex == 1) {
list1.style.display='none';
list1.options.length = 0;
for (var i=list1.options.length; i<10; i++) {
            list1.options[i] = new Option("0 Selected Index " + i, "");
       }
       list1.style.display='block';
} else if (list.selectedIndex == 2) {
       list1.style.display='none';
list1.options.length = 0;
       for (var i=list1.options.length; i<20; i++) {
            list1.options[i] = new Option("1 Selected Index " + i, "");
       }
       list1.style.display='block';
}
}
</script>
</h3>
<form name="form1" method="post" action="">
  <p align="center">
    List 1:
    <select name="select" onchange="refreshOptions(this.form.select, this.form.select1);">
      <option>Default</option>
      <option>item 2</option>
      <option>item 3</option>
    </select>
  </p>
  <p align="center">
    List 2:
    <select name="select1">
      <option>Default</option>
    </select>
  </p>
</form>
<h3 align="center">&nbsp;</h3>
  </body>
</html>
======================================================================================================