[This post is now obsolete]
I have been having issues positioning jQuery UI dialogs for a long time.
What I expect from a modal dialog is simple:
- it must be centered on the screen
- if I scroll the page, the dialog should still be at the center of the screen (fixed position)
- when I invoke the dialog for example by clicking a link, the page must not scroll either
- when I close the dialog, the page must not scroll up or down
- dialog shows up off screen (scrolling is required to be able to see the dialog)
- dialog is not centered on the screen
- when the dialog is opened, the page scrolls up or down
- when the dialog is closed, the page scrolls up or down
- combinations of several of the above issues
jQuery Center Dialog plugin
|The argument of the center() function must be set to false in order to give the dialog a fixed position. |
This worked like a charm for me, I hope it will work for you too. Also note that there are probably a hundred different ways to do this, but you must admit this is pretty simple.