How to remove the close button in a dialog box?

I want to hide the close button in the title bar of a dialog box. I want the user to strictly follow the steps in the dialog, so limit the way you hide the dialog.

+3
source share
2 answers

Try the following:

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

You can hide the close button when opening a dialog box.

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

This event is fired when a dialog is opened. Code examples

Set a callback function to handle an open event as an init parameter.

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

Bind to an open event by type: dialogopen.

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

Better yet, use CSS ...

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

Source: https://habr.com/ru/post/1754356/


All Articles