Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Effect on close for jQuery UI dialog

I'm using the following code for managing the jQuery UI dialog:

$("#mydialog").dialog({
      autoOpen: false,
      title: "myDialog",
      modal: true,
      width: "800",
      hide: null,
      open: function(event, ui){  
        //some code
    },
     close: function(event, ui){ 
        $("#mydialog").dialog("option", "fade", null);       
    }
});

And then I open the dialog calling this code:

$("#mydialog").dialog("option", {
    modal: true
}).dialog("open");

This works fine, but I can't see any effect when I close the dialog.

How modify my code in order to obtain this result?

like image 506
GVillani82 Avatar asked Dec 01 '25 08:12

GVillani82


1 Answers

If i understand correctly you want your dialog to close with a fading effect.

    $("#mydialog").dialog({
    autoOpen: false,
    title: "myDialog",
    modal: true,
    width: "800",
    hide: { effect: "fade", duration: 200 } //put the fade effect
});
like image 154
Panos Avatar answered Dec 02 '25 22:12

Panos