2010-09-19 15 views

回答

1

您可以添加DIV#對話框,確認動態地

$(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(); 
+0

感謝爲我的作品,但它並不像jQuery的對話框,它幾乎沒有CSS格式化 – 2010-09-19 09:31:24

+0

你添加UI樣式'HTTP: // ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css' – jcubic 2010-09-19 09:53:13

+0

我添加href =「/ js/jquery/css/custom-theme/jquery-ui-1.8 .4.custom.css「,似乎是正確的 – 2010-09-19 10:35:50

1

您可以簡單地使用$('body')包圍在一個jQuery包裝文檔正文對象,該行爲。