Wednesday, March 11, 2015

Set JQuery UI modal dialog overlay background color

To remove the strip and use a custom background color you can do like this on the open event :

open : function(event, ui){
    $("body").css({
        overflow: 'hidden'
    });
    $(".ui-widget-overlay").css({
        background:"rgb(0, 0, 0)",
        opacity: ".50 !important",
        filter: "Alpha(Opacity=50)",
    });
},
beforeClose: function(event, ui) {
    $("body").css({ overflow: 'inherit' })
}

Reference:

http://stackoverflow.com/questions/5583995/set-jquery-ui-modal-dialog-overlay-background-color

No comments: