jQuery UI dialog box not positioned center screen

后端 未结 23 3136
失恋的感觉
失恋的感觉 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:10

    Digging up an old grave here but for new Google searchers.

    You can maintain the position of the model window when the users scrolls by adding this event to your dialog. This will change it from absolutely positioned to fixed. No need to monitor scrolling events.

    open: function(event, ui) {
        $(this).parent().css('position', 'fixed');
    }
    

提交回复
热议问题