Replacing the Close icon for a JQueryUI Dialog box

前端 未结 2 1394
终归单人心
终归单人心 2021-02-13 18:23

After extensive searching on this topic, I haven\'t been able to find an answer, so hopefully someone can help me with this issue. I have a relatively basic dialog box:

2条回答
  •  难免孤独
    2021-02-13 19:03

    Try to see the structure of the dialog and it should not be hard to do it.

    http://jqueryui.com/demos/dialog/#theming

    Use the create event to change the class of the close button icon to class of another icon will do.

    http://jsfiddle.net/Quincy/kHU2M/1/

    $("#dialog-search").dialog({
        create: function(event, ui) { 
          var widget = $(this).dialog("widget");
          $(".ui-dialog-titlebar-close span", widget)
              .removeClass("ui-icon-closethick")
              .addClass("ui-icon-minusthick");
       }
    });
    

提交回复
热议问题