开发者

JQuery popup issue in IE

IE shows scrollbars when JQuery Dialog pops up. FF doesnt show scrollbars. Whats wrong with IE CSS?

&开发者_运维问答lt;div id="disablebg" style="display: none;overflow:hidden;">
                <uc1:CreateInqGeneral ID="CreateInqGeneral1" runat="server" />
            </div>

 function ShowDialog() {

        $("#disablebg").dialog({
            resizable: false,
            modal: true,
            width: "550px"
        }); 
    }


I use something like this to avoid this problem. You can easily modify it to hide the horizontal scrollbar only.

function hideScrollBars() {
    var top = $('html').scrollTop();
    var left = $('html').scrollLeft();
    $('html').css('overflow', 'hidden');
    $('html').scrollTop(top);
    $('html').scrollLeft(left);
}

function showScrollBars() {
    var top = $('html').scrollTop();
    var left = $('html').scrollLeft();
    $('html').css('overflow', 'auto');
    $('html').scrollTop(top);
    $('html').scrollLeft(left);
}

$.extend($.ui.dialog.prototype.options, {
    bgiframe: true,
    resizable: false,
    modal: true,
    open: function () { hideScrollBars(); },
    close: function () { showScrollBars(); }
});

Note: this way I set the open and close events globaly for all dialog instances. If you overwrite the open/close events on specific instances, you have to call the hideScrollBars/showScrollBars functions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜