• support@answerspoint.com

How to remove close button on the jQuery UI dialog?

2583

How do I remove the close button (the X in the top-right corner) on a dialog box created by jQuery UI?

1Answer


0

I have found this worked in the end (note the third line overriding the open function which find the button and hides it):

$("#div2").dialog({
   closeOnEscape: false,
   open: function(event, ui) { $(".ui-dialog-titlebar-close", ui.dialog | ui).hide(); }
});

To hide the close button on all dialogs you can use the following CSS too:

.ui-dialog-titlebar-close {
  visibility: hidden;
}
  • answered 8 years ago
  • Gul Hafiz

Your Answer

    Facebook Share        
       
  • asked 8 years ago
  • viewed 2583 times
  • active 8 years ago

Best Rated Questions