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?
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?
You can simply use $('body')
to enclose the document body object in a jQuery wrapper, and act on that.
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();