views:

23

answers:

2

Hi,

in this example the dialog is added to an #dialog-confirm element. But I want it to be added just to the body and I do not want any predefined div#dialog-confirm element in my html. So how do I realize that?

alt text

A: 

You can simply use $('body') to enclose the document body object in a jQuery wrapper, and act on that.

RMorrisey
A: 

You can add div#dialog-confirm dynamicly

$(document.documentElement).append('<div id="dialog-confirm" title="Empty the '+
   'recycle bin?"<p><span class="ui-icon ui-icon-alert" style="float:left; ' +
   'margin:0 7px 20px 0;"></span>These items will be permanently deleted and' +
   ' cannot be recovered. Are you sure?</p></div>');

$( "#dialog-confirm" ).dialog();
jcubic
thanks that works for me, but it does not look like the jquery dialog, it has nearly no css formating
ArtWorkAD
Did you add UI stylesheet `http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css`
jcubic
I add href="/js/jquery/css/custom-theme/jquery-ui-1.8.4.custom.css", seems to be correct
ArtWorkAD
I've added a screenshot above
ArtWorkAD
see this `http://jcubic.pl/test.html` it's seem look fine. The dialog has Gray style, has title bar and icon.
jcubic
ok looks just like mine but the font and the buttons are very big
ArtWorkAD