jQuery UI dialogs: how to close dialog when click outside?

后端 未结 5 1015
夕颜
夕颜 2020-12-15 13:24

In docs I didn\'t see such information.

There are options to close dialog in such cases:

1) push Esc;

2) click on \"OK\" or \"Close\" buttons in the

5条回答
  •  再見小時候
    2020-12-15 13:49

    If dialog is modal, then paste these 3 lines of code in the open function when you create your dialog options:

    open: function(event,ui) {
        $('.ui-widget-overlay').bind('click', function(event,ui) {         
            $('#myModal').dialog('close');
        });
    }
    

提交回复
热议问题