div弹层遮盖select组件

IE6的情况下select框会遮住div层,必须用个iframe才能遮住select框
<div class="myAccount_tc_1" id="user_chooser" style="display: none; z-index: 99999; position: absolute;">
  <form action="#" id="user_form">

  <table class="mBlogLayer">
.....
 </table>
 </form>
</div>
这个iframe放在div下面
<iframe id="user_chooser_frame" src="javascript:false;" scrolling="no"
    frameborder="0"
    style="position: absolute; top: 0px; left: 0px; display: none; filter =progid: DXImageTransform.Microsoft.Alpha (   style =   0, opacity =   0 );">
</iframe>
js代码:
var divRef = document.getElementById('user_chooser');
        var ifrRef = document.getElementById('user_chooser_frame');
        ifrRef.style.width = divRef.offsetWidth;
        ifrRef.style.height = divRef.offsetHeight;
        ifrRef.style.top = divRef.style.top;
        ifrRef.style.left = divRef.style.left;
        ifrRef.style.zIndex = divRef.style.zIndex - 1;
        ifrRef.style.display = "block";
把iframe大小设置和div大小一样,并且zIndex设置成div的zIndex-1,只要比div的小就行。
不信你试试~

你可能感兴趣的:(遮盖,div弹层,select组件)