jQuery UI Dialog - missing close icon

前端 未结 17 2181
礼貌的吻别
礼貌的吻别 2020-11-28 19:15

I\'m using a custom jQuery 1.10.3 theme. I downloaded every straight from the theme roller and I have intentionally not changed anything.

I created a dialog box and I

17条回答
  •  独厮守ぢ
    2020-11-28 19:36

    I'm using jQuery UI 1.8.17 and I had this same issue, plus I had additional css stylesheets being applied to things on the page, including the titlebar color. So to avoid any other issues, I targeted the exact ui elements using the code below:

    $("#mydialog").dialog('widget').find(".ui-dialog-titlebar-close").hide();    
    $("#mydialog").dialog('widget').find('.ui-icon ui-icon-closethick').hide();
    

    Then I added a close button in the properties of the dialog itself: ...

    modal : true,
    title: "My Dialog",
    buttons: [{text: "Close", click: function() {$(this).dialog("close")}}],
    ...
    

    For some reason I had to target both items, but it works!

提交回复
热议问题