I am attempting to use the jQuery UI dialog script in my WordPress theme admin page. Everything is straight from the UI demo and yet I end up with a dialog box where the dialog is not popped up over anything and instead buried in bottom corner, just before the closing body tag.
The UI dialog script is queued properly w/ wp_enqueue_script as its shows up in the source code as does jquery (from google API) and the UI core.
jQuery(document).ready(function($) {
$("#dialog").dialog();
}); //end onload stuff
Then I have this in my options page:
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
You should be all ready to go. WP already has dialog and styles for it.
Here are the steps to use it:
dialogClass
ofwp-dialog
init
using the proper dependencies (jquery-ui-dialog
)wp-jquery-ui-dialog
)For example:
In your PHP
I manged to show the dialog using the following code (but styling was not applied!):
When calling it used:
I don’t know if it makes any difference (because I’m not in the right place to do any testing at the moment), but maybe try the code exactly as it is on the jQuery UI site:
Best of luck! ^.^