jQuery UI dialog box not positioned center screen

后端 未结 23 3143
失恋的感觉
失恋的感觉 2020-12-01 00:31

I have a jQuery dialog box that is meant to position in the middle of the screen. However, it seems slightly off-center vertically.

Here is the code:

         


        
23条回答
  •  忘掉有多难
    2020-12-01 01:23

    This is how I solved the issue, I added this open function of the dialog:

      open: function () {
                    $('.ui-dialog').css("top","0px");                                
                        }
    

    This now opens the dialog at the top of the screen, no matter where the page is scrolled to and in all browsers.

提交回复
热议问题