开发者

remove cross in the dialog jquery

I dont want the cross for closing the dialog bo开发者_运维知识库x to appear in the dialog box im 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
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜