最简单的办法!!!显示Menu的之前,隐藏Select最好的办法,加一个Iframe,在Iframe中显示Menu
因为Select的优先级别是最高的!!一般的页面对象都在其之下1!
=====================Lion技术文章站
http://www.mysharespace.cn
小站初起,请多关照!!
因为Select的优先级别是最高的!!一般的页面对象都在其之下1!
=====================Lion技术文章站
http://www.mysharespace.cn
小站初起,请多关照!!
function sohAllSelect(opt) {
var allSelect = document.getElementsByTabName("select");
if (opt == "show") {
for (var i=0; i<allSelect.length; i++) {
allSelect[i].style.visibility = "hidden";
}
} else if (opt == "hide") {
allSelect[i].style.visibility = "visible";
}
}
1.IE6会有这样的问题 Select, Iframe都是模态控件 它们的层次系统默认就高于其他控件 导致设置Z-index无效
解决方法:菜单中加入Iframe对象并把透明设为0 来覆盖SELECT(Iframe zIndex必须大于Select);2.IE7以解决该问题 DIV直接设置Z-Index可以覆盖 Select
http://hansir.cn/blog/2008/20081106-38.html
IE8 连Z INDEX 都不用...
<div id="cusSortDiv" style="display:none;z-index:123; cursor:hand">
<table width="100%" cellspacing="3" cellpadding="0">
<tr> <td onmouseover="changeMouseOver(this)" onmouseout="changeMouseOut(this)" onclick="TextWrite('cusSort','cusSortDiv','个人')">个人</td> </tr>
<tr> <td onmouseover="changeMouseOver(this)" onmouseout="changeMouseOut(this)" onclick="TextWrite('cusSort','cusSortDiv','企业')">企业</td> </tr>
<tr> <td onmouseover="changeMouseOver(this)" onmouseout="changeMouseOut(this)" onclick="TextWrite('cusSort','cusSortDiv','政府')">政府</td> </tr>
</table>
</div>先是 cusSortDivF 显示在select上面 然后 cusSortDiv 显示在cusSortDivF上面啊
怎么扯上iframe了?
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312" />
</head>
<body style="margin:0px">
<input type="button" onclick="Show()" value="显示遮盖层" />
<br/><br/><br/><br/>
<select><option>11111111</option></select>
<table border='1' id='tb'>
<tr><td>8</td><td>9</td><td>10</td><td>11</td></tr>
<tr><td>12</td><td>13</td><td>14</td><td>15</td></tr>
<tr><td>16</td><td>17</td><td>18</td><td>19</td></tr>
<tr><td>20</td><td>21</td><td>22</td><td>23</td></tr>
<tr><td>24</td><td> </td><td><select><option>11111111</option></select></td><td> </td></tr>
</table>
<br /><select><option>11111111</option></select>
<iframe src="about:blank"></iframe><select><option>11111111</option></select>
<div id="divMark" style="position:absolute;left:0px;top:0px;width:100%;height:100%;filter:alpha(opacity=70);opacity:0.7;display:none;background-color:#333333;z-index:100;"><!--使用透明iframe作为底-->
<iframe src="login.htm" style="position:absolute; visibility:inherit;top:0px; left:0px; width:100%; height:100%; z-index:-1;filter='alpha(style=0,opacity=0)';"></iframe>
</div>
<script>
function Show(){
document.getElementById('divMark').style.display="block";
}
</script>
</body>
</html>
MENU 被 select 挡住,就是用iframe的方法解决的。
谢谢大家!!!