jQuery Modal Dialog : Hide That Stupid X Button / Windows Close Button

This is quick one, so hold on to your… whatever.

Want to get rid of that X at the top right of the modal “Control”? Well here it is: (The bold part, moron)

     jQuery('#WaitingDiv').dialog({
          autoOpen: false,
          bgiframe: false,
          height: 150,
          width: 200,
          modal: true,
          open: function(event, ui) { jQuery('.ui-dialog-titlebar-close').hide(); }
        });

And that’s really it. Just thought I’d pass that on to you, the consumer.

On a side note, the big movie thing is the canceling of Spiderman 4 or at least going in a new direction. As much as I don’t care, it might lead to my dream come true:

A spiderman movie based on the SNES classic: Spider-Man & Venom: Maximum Carnage. Uwe Boll, are you out there?

13 thoughts on “jQuery Modal Dialog : Hide That Stupid X Button / Windows Close Button”

  1. Thanks a lot! Very useful tip, so now i can also hide jther unnessesary elements 🙂

  2. Thanks a buddy!…. i wanted to use Close instead of that stupid X.

    i could do that by doing following.

    open: function(event, ui) { $(‘.ui-icon’).removeClass(‘ui-icon’) }

    is there a better way ?

  3. or… use the method “dialogClass” that is built in 😉

    dialogClass: ‘noTitle’

    .noTitle .ui-dialog-titlebar {display:none;}

Comments are closed.