IE6 將 <select> 渲染為系統級 ActiveX 控件,其 z-index 永遠高於普通 HTML 元素,導致彈窗、下拉菜單被遮蓋。
<script src="resources/js/plugins/jquery/jquery.bgiframe.min.js"></script>
$("#div_bksq").bgiframe();
<div class="gjcx_pop" id="div_bksq" style="display:none; background:white; height:480px; margin-top:-240px;">
<div class="gjcx_pop_tit" id="div_bksq_tit" style="cursor:move;">
<span>
<img src="search_ico.gif" />
<font class="sxcx_titText">
<input type="text" id="txt_bt" style="border:0; width:60px; font:bold 13px '宋體'; color:#00517e;" />
</font>
</span>
<img src="alert_close.jpg" id="img_gb" style="cursor:pointer;" title="關閉" />
</div>
<div class="qvyu" id="qyTree"><div class="qvyu_n">...</div></div>
</div>
bgiframe 在目標元素後插入一個透明的 <iframe>,利用 IE6 中 iframe 可遮蓋 select 的特性,將 iframe 置於彈窗與 select 之間,形成「彈窗 > iframe > select」層級關係。
<!--[if lte IE 6]><script src="bgiframe.js"></script><![endif]-->