Make the jQuery UI dialog box do not change its position (relative to the browser) when scrolling the browser

when I open the jQuyery UI dialog box, I can scroll the browser and the dialog will change its position relative to the browser window, I want it to remain in the same position relative to the browser

+3
source share
1 answer

There is an option in the user interface dialog dialogClasswhere you can specify the css classes that are added to the dialog style. This way you can define a class, for example:

.dialogFixed {
    position: fixed !important;
}

and call the dialog box like:

$(function() {
    $( "#dialog" ).dialog({
        dialogClass: 'dialogFixed'
    });
});

A fixedposition should fit your requirements here.

Demo : http://jsfiddle.net/MpHN9/

(, css , , . , )

+4

All Articles