开发者

how to remove the close button in dialog?

开发者 https://www.devze.com 2023-01-07 02:54 出处:网络
I want to hide the close button in the title bar of the dialog box. I want the user strictly complete the 开发者_JS百科steps in dialog, so restrict the ways of hiding the dialog.Try this:

I want to hide the close button in the title bar of the dialog box. I want the user strictly complete the 开发者_JS百科steps in dialog, so restrict the ways of hiding the dialog.


Try this:

$(".ui-dialog-titlebar-close").hide();

You can hide close button on dialog's open event.

Ref : http://jqueryui.com/demos/dialog/#event-open

This event is triggered when dialog is opened. Code examples

Supply a callback function to handle the open event as an init option.

$( ".selector" ).dialog({
   open: function(event, ui) { ... }
});

Bind to the open event by type: dialogopen.

$( ".selector" ).bind( "dialogopen", function(event, ui) {
  ...
});


Even better, use CSS...

.ui-dialog-titlebar-close {
display:none;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消