日期:2014-05-17  浏览次数:20889 次

怎么解决select层级最高的问题
select层级最高,使用z-index不起作用
------最佳解决方案--------------------
在IE中,弹出层一般会被select挡过,现在有这个几个方法:
一是,设置一个跟弹出层一样大小的iframe,置于弹出层下面,
如div的z-index:100, iframe 的为 z-index:99;
你可以查看这个:IE6:防止Select等元素遮挡弹出Div层 
二是,在网站找一下弹出层插件,一般的插件都会处理这个问题的。
  点击这里查看
三是,用DIV替换select功能,同样达到下拉选择的效果及功能。
   DIV+CSS+JS仿Select下拉表单,兼容IE全系列,火狐,谷歌,open等浏览器 
------其他解决方案--------------------
ie6下select层级就是最高的~一般是用iframe挡住或者隐藏的。


(function($){

$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
    s = $.extend({
        top     : 'auto', // auto == .currentStyle.borderTopWidth
        left    : 'auto', // auto == .currentStyle.borderLeftWidth
        width   : 'auto', // auto == offsetWidth
        height  : 'auto', // auto == offsetHeight
        opacity : true,
        src     : 'javascript:false;'
    }, s);
    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
                   'style="display:block;position:absolute;z-index:-1;'+
                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)