Icons in jQuery UI dialog title

后端 未结 5 973
一整个雨季
一整个雨季 2020-12-28 15:47

I\'m using the code below to create a jQuery dialog box. By default there is a close icon on title bar, but I want to add some of the other icons in title bar as well for di

5条回答
  •  Happy的楠姐
    2020-12-28 16:33

    Here is how you solve the jQuery UI 1.10.0 dialog title issue globally instead of one object at a time:

    jQuery.widget('ui.dialog', jQuery.extend({}, jQuery.ui.dialog.prototype, {
        _title: function(titleBar) {
            titleBar.html(this.options.title || ' ');
        }
    }));
    

    Now use the dialog widget as usual and your titles won't get escaped anymore.

提交回复
热议问题