【问题标题】:pop up not showing in IE 6弹出不显示在 IE 6
【发布时间】:2011-09-27 21:12:54
【问题描述】:

嗨,我正在使用 jquery 来显示一个弹出窗口,它适用于除 IE 6 之外的所有浏览器。想不通是什么原因。这是我的代码,请帮助......

function showCalendar(){ 
    $('body').prepend('<div id="overlay"></div>');
    if($.browser.msie && $.browser.version=="6.0"){
        $('#overlay').append('<iframe></iframe>');
    }
    $('#overlay').height($(document).height());
    $('body').append('<div id="popupwrapper"><div id="calendar"></div></div>');

    if (calculated.calendar) {
        $('#calendar').emeCalendar(calculated.calendar);
    }

    $('#calendar div.header div.clearboth').before('<span class="close">Close</span>');

    $('#calendar div.header span.close').click(function(){
        $('#overlay').remove();
        $('#popupwrapper').remove();
    });

}

更新

这是我的 CSS

#overlay {
    position : absolute;
    z-index : 5000;
    left : 0px;
    top : 0px;
    width : 100%;
    background-color : #000;
    opacity : 0.5;
}


#popupwrapper {
    position : fixed;
    z-index : 6000;
    left : 50%;
    width : 800px;
    margin-left : -400px;
    top : 20%;
    background-color : #f2efe6;
    border : 3px solid #FFF;
}


    #popupwrapper span.close{
        float : right;
        cursor : pointer;
    }


    #calendar {
        width : 100%;
    }
        #calendar table {
            width : 100%;
            border-spacing : 10px;
            font-size : 10px;
        }

        #calendar table td {
            background-color : #fff;
            padding : 3px 3px 10px 3px; 
        }
            #calendar table td.empty {
                background-color : transparent;
            }

        #calendar div.date {
            background-color : #5a4530;
            color : #FFF;
            text-align : right;
            font-weight : bold;
            padding : 2px;
        }
        #calendar div.offer {
            color : #5b4530;
            border-bottom : 1px solid #5b4530;
            padding-top : 8px;
        }
        #calendar div.room {
            clear : left;
            float : left;
            padding-top : 2px;
        }
        #calendar div.cost {
            clear : right;
            float : right;
            padding-top : 2px;
        }
        #calendar div span {
            padding : 2px;
        }

【问题讨论】:

  • 虽然我会说忽略 IE6 但是....好吧,如果它是 ie 6,你为什么要附加 iframe
  • 您能否更准确地解释一下 ie6 中发生了什么以及应该发生什么?
  • 在 IE6 中没有显示弹出窗口,整个页面似乎都被禁用了。无法点击任何地方
  • 哦,我滚动到页面底部,我可以看到我的部分弹出窗口显示在窗口的左下角,但整个页面被禁用,但我可以点击我的弹出窗口的关闭按钮
  • 或许定位时髦?

标签: php jquery css internet-explorer-6


【解决方案1】:

尝试将 append 切换到 appendTo 并 prepend 到 prependTo - 当然,还有 dom 引用 (this).append(other) 与 (other).appendTo(this) 的顺序

IE 对 DOM 操作有一些奇怪的行为 - jQuery 消除了大部分的怪癖,但仍然存在一些。我在另一个项目中遇到了这个问题,这个想法对我有用。

【讨论】:

  • 哦,我滚动到页面底部,我可以看到我的部分弹出窗口显示在窗口的左下角,但整个页面被禁用,但我可以点击我的弹出窗口的关闭按钮
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-03
  • 1970-01-01
  • 1970-01-01
  • 2011-03-18
  • 1970-01-01
相关资源
最近更新 更多