在IE下下拉框的层级最高,可以考虑在overlib的容器里添加iframe来解决,下面代码给你参考,_plane是容器对象。
var isIE = /msie/i.test(navigator.userAgent)&&(!/opera/i.test(navigator.userAgent));
if (isIE) {
ifm = document.createElement("iframe");
var s = ifm.style;
ifm.frameBorder = 0;
if (_plane.style.height) {

s.height = _plane.style.height + parseInt(_plane.currentStyle.borderTopWidth, 10) + parseInt(_plane.currentStyle.borderBottomWidth, 10);
s.top = -parseInt(_plane.currentStyle.borderTopWidth, 10) + "px";
s.left = -parseInt(_plane.currentStyle.borderLeftWidth, 10) + "px";
s.width = parseInt(_plane.style.width, 10) + parseInt(_plane.currentStyle.borderLeftWidth, 10) + parseInt(_plane.currentStyle.borderRightWidth, 10) + "px";
}else
{
s.height = _plane.clientHeight;
s.top = "0px";
s.left = "0px";
s.width = _plane.clientWidth;
}
s.visibility = "inherit";
s.filter = "alpha(opacity=0)";
s.position = "absolute";
s.zIndex = -1;
_plane.insertAdjacentElement("afterBegin",ifm);

}

解决方案 »

  1.   

    一般情况下,在显示其他层时,隐藏select 是ie里比较常见的做法。 比如日历控件的显示。好像ie7 ,select的zindex可以生效了。没验证过
      

  2.   

    可以用display='none'先隐藏select 再打开
      

  3.   

    无论我把overlib的zindex设为多大,select总会遮盖弹出框。to summitseu :select没有display属性阿
      

  4.   

    style="display:none" 是风格不是属性
    显示:style="display:block" 
      

  5.   

    没有下到overlib4.21版本,如果你用的版本里,也有function layerWrite(txt) {
            if (ns4) {
                    var lyr = document.overDiv.document
                    lyr.write(txt)
                    lyr.close()
            }
            else if (ie4) document.all["overDiv"].innerHTML = txt
    if (tr) { trk(); }}
    这个函数的话
    在后面添加
    var   isIE   =   /msie/i.test(navigator.userAgent)&&(!/opera/i.test(navigator.userAgent)); 
    if   (isIE)   { 
    var _plane=document.overDiv;
    ifm   =   document.createElement("iframe"); 
    var   s   =   ifm.style; 
    ifm.frameBorder   =   0; 
    if   (_plane.style.height)   { s.height   =   _plane.style.height   +   parseInt(_plane.currentStyle.borderTopWidth,   10)   +   parseInt(_plane.currentStyle.borderBottomWidth,   10); 
    s.top   =   -parseInt(_plane.currentStyle.borderTopWidth,   10)   +   "px"; 
    s.left   =   -parseInt(_plane.currentStyle.borderLeftWidth,   10)   +   "px"; 
    s.width   =   parseInt(_plane.style.width,   10)   +   parseInt(_plane.currentStyle.borderLeftWidth,   10)   +   parseInt(_plane.currentStyle.borderRightWidth,   10)   +   "px"; 
    }else 

    s.height   =   _plane.clientHeight; 
    s.top   =   "0px"; 
    s.left   =   "0px"; 
    s.width   =   _plane.clientWidth; 

    s.visibility   =   "inherit"; 
    s.filter   =   "alpha(opacity=0)"; 
    s.position   =   "absolute"; 
    s.zIndex   =   -1; 
    _plane.insertAdjacentElement("afterBegin",ifm); }
    隐藏select也可以select.style.display='none'或者select.style.visibility='hidden'
      

  6.   

    隐藏select不行,因为popup出来时,select也要显示出来。layerWrite这个函数是有,但不一样,下面是将tutu83612 的代码加入后的函数
    function layerWrite(txt) {
    txt += "\n";
    if (olNs4) {
    var lyr = o3_frame.document.layers['overDiv'].document
    lyr.write(txt)
    lyr.close()

    else if (typeof over.innerHTML != 'undefined') {
    if (olIe5 && isMac) over.innerHTML = '';
    over.innerHTML = txt;

    else {
    range = o3_frame.document.createRange();
    range.setStartAfter(over);
    domfrag = range.createContextualFragment(txt);

    while (over.hasChildNodes()) {
    over.removeChild(over.lastChild);
    }

    over.appendChild(domfrag);
    } var isIE =/msie/i.test(navigator.userAgent)&&(!/opera/i.test(navigator.userAgent));   
    if (isIE) {
    var _plane = document.overDiv;
    ifm = document.createElement("iframe"); 1
    var s = ifm.style;  
    ifm.frameBorder = 0;  
    if (_plane.style.height){
    s.height = _plane.style.height + parseInt(_plane.currentStyle.borderTopWidth, 10) + parseInt(_plane.currentStyle.borderBottomWidth, 10);  
    s.top = -parseInt(_plane.currentStyle.borderTopWidth, 10) + "px";
    s.left = -parseInt(_plane.currentStyle.borderLeftWidth, 10) + "px";
    s.width = parseInt(_plane.style.width, 10) + parseInt(_plane.currentStyle.borderLeftWidth, 10) + parseInt(_plane.currentStyle.borderRightWidth, 10)+ "px";
    } else {  
    s.height = _plane.clientHeight;
    s.top = "0px";  
    s.left = "0px";
    s.width = _plane.clientWidth;
    }
    s.visibility = "inherit";
    s.filter = "alpha(opacity=0)";  
    s.position = "absolute";  
    s.zIndex = -1;  
    _plane.insertAdjacentElement("afterBegin",ifm);
    }
    }但是脚本执行时,会报“style为空或不是对象”的错误,这个代码我还不是很明白,不过正在理解。
    另外,overlib421版在我的资源里可以下到,多谢tutu83612 !
      

  7.   

    将下面这句
    var _plane   =   document.overDiv; 
    改为
    var _plane = document.getElementById("overDiv");
    就OK了
      

  8.   


    请问tutu83612:在overlib里如何设置popup的行距?
      

  9.   

    感谢各位,特别是tutu83612,我的问题已经解决了!