Mike
Mike

Reputation: 2900

How to trigger an event when any jQuery UI dialog is closed?

I would like to make it so that when a jQuery UI dialog is closed, the document's focus event is fired. This would preferably not be tied to each dialog but to the page itself whenever any dialog closes.

How can I do this?

Upvotes: 1

Views: 1946

Answers (3)

Abdul Kader
Abdul Kader

Reputation: 5842

  $("#image_div").dialog({
      height:500,
      width:600,
      maxHeight: 700,
      minWidth: 700,
      modal: true,
      title:'Crop Your Profile Image',
      close: function() {  
        //your event
      },
      buttons : {...}
  });

Upvotes: 0

Anuraj
Anuraj

Reputation: 19598

Did you checked this

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

Upvotes: 0

S L
S L

Reputation: 14318

$( ".selector" ).dialog({
   close: function(event, ui) { $('#txt').focus(); }
});

Upvotes: 5

Related Questions