I dont want the cross for closing the dialog bo开发者_运维知识库x to appear in the dialog box i
m creating. How can I do that?
Also, if on clicking on the cross in the dialog I want to have destroy and not close, how can I do that?
You don't want the X, but if it is clicked, you want to destroy the box? You have to decide on one or the other.
But to destroy it on close, the following should work (you'll have to modify the selector with whatever class or ID you're using):
$(".selector").dialog({
close: function(event, ui) {
$(this).dialog("destroy");
}
});
Edit for below comment:
As far as I can see, there is no option to disable the button. However, you can hack it by hiding it (untested):
$(".selector").dialog({
open: function(event, ui) {
//$(".ui-dialog-titlebar-close").hide();
$("a.ui-dialog-titlebar-close").remove(); //courtesy of user281180, see below
}
});
精彩评论