extend jquery ui dialog (add more options)

后端 未结 2 1726
一向
一向 2020-12-18 12:18

how I can create and add new options for jQuery dialog? for example: I like that through on the setting options can control the display of title bar or display the close but

2条回答
  •  半阙折子戏
    2020-12-18 12:56

    Starting from jQuery UI 1.9 , you can extend widgets in a much nicer way without creating a new widget.

    http://learn.jquery.com/jquery-ui/widget-factory/extending-widgets/

    See - Redefining Widgets.

    $.widget( "ui.dialog", $.ui.dialog, {
        open: function() {
            console.log( "open" );
            return this._super();
        }
    });
    
    $( "
    " ).dialog();

提交回复
热议问题