HOW TO REMOVE CLOSE BUTTON ON THE JQUERY UI DIALOG?

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
 1236  View(s)
Ratings:
Rate this:

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

  1. Alex Leblois

    Post:67

    Points:471
    Re: How to remove close button on the jQuery UI dialog?

    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;
    }

      Modified On Apr-09-2018 04:01:07 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!