1

I'm having trouble getting the jquery ui 1.8 dialog to center

I've tried leaving the options default, and setting position: 'center'. When the dialog displayed, the browser window gets scrolled down to the centre of the page, and the dialog is positioned at the bottom left of the window.

This worked fine with jquery 1.3.2 and ui 1.7.2. Is there something new I need to do with this version?

3 Answers 3

2

Figured it out. You must now include the following js files:

http://scripts/jquery-ui-1.8/jquery.ui.core.js
http://scripts/jquery-ui-1.8/jquery.ui.widget.js
http://scripts/jquery-ui-1.8/jquery.ui.position.js
http://scripts/jquery-ui-1.8/jquery.ui.dialog.js
Sign up to request clarification or add additional context in comments.

Comments

0

I don't know if it is the correct way to do it, but the following code seems to work.

50 pixels from the top and center:

.dialog( {....
          position : [ null, 50 ],
          ....

I guess that [null,null] will center vertically as well.

But reading the docs, 'center' should work and it should be the default.

Comments

0

What about loading the whole library from google. Like this:

google.load("jquery","1.4.2");
google.load("jqueryui","1.8.1");

I have this problem with the positioning of the dialog after upgrading from 1.7.2 to jqueryui 1.8.1 too. However, I think that all the necessary libraries are included in there, so I don't have to include the separate libs.

Any ideas what could be missing or should be done in order to make the dialog work and be positioned in the center?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.