`

防止下拉框挡住上面的层的解决方案

    博客分类:
  • JSP
 
阅读更多
问题原因:在ie6下,弹出层时,下拉框会显示在层上面,有些操作不能正常进行。
解决法案:由于层与下拉框之间的优先级是:下拉框 > 层,因此在显示的时候,会因为优先级的次序而会出现如上问题。(如果几个元素都是层的话,我们可以通过层的 z-index 属性来设置)解决办法就是:给层中放一个优先级比下拉框更高的元素(iframe),从而解决此问题!

代码如下:

<div id="tab3" style="width:660px;height:440px;background:#fee;">
<div id="tabtop3">
<div id="tabtop-L3" onMousedown="StartDrag(this)" onMouseup="StopDrag(this)" onMousemove="Drag(this)">
<strong style="color:red;font-size:20px">可拖动层的标题</strong></div>
</div>
<div id="tabcontent3" style="padding:8px">
<table align="center" border="0" width="100%" height="100%">
<tr height="">
<td colspan="5">一级分类</td>
<td><div id="tabtop-R3" onclick="closeLayer()"><strong><center>[关闭层]</center></strong></div></td>
</tr>
<tr>
<td align="left">
<c:if test="${empty mrmResources.field0 }">
<input  type="checkbox" name="field0" id ="field0" value="上海综合"/>上海综合
</c:if>
<c:if test="${not empty mrmResources.field0 }">
<input  type="checkbox" name="field0" id ="field0" value="上海综合" checked="checked"/>上海综合
</c:if>
</td>
<td align="left">
<c:if test="${empty mrmResources.field0 }">
<input  type="checkbox" name="field1" id ="field1" value="特别专题"/>特别专题
</c:if>
<c:if test="${not empty mrmResources.field1 }">
<input  type="checkbox" name="field1" id ="field1" value="特别专题" checked="checked"/>特别专题
</c:if>
</td>
<td align="left">
<c:if test="${empty mrmResources.field2 }">
<input  type="checkbox" name="field2" id ="field2" value="常规专题"/>常规专题
</c:if>
<c:if test="${not empty mrmResources.field2 }">
<input  type="checkbox" name="field2" id ="field2" value="常规专题" checked="checked"/>常规专题
</c:if>
</td>
<td align="left">
<c:if test="${empty mrmResources.field3 }">
<input  type="checkbox" name="field3" id ="field3" value="素材" />素材
</c:if>
<c:if test="${ not empty mrmResources.field3 }">
<input  type="checkbox" name="field3" id ="field3" value="素材" checked="checked"/>素材
</c:if></td>
<td align="left"></td>
<td align="left"></td>
</tr>

                    </table>
<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100%; height:100%;z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"> </iframe>
</div>
</div>
</div>
0
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics