Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: fading in modal dialog

is it possible to smoothly fadein a jquery modal dialog? (can't find anything in the docs). i've tried fadeTo but didn't help.

like image 805
Fuxi Avatar asked Aug 08 '10 11:08

Fuxi


2 Answers

You can use the show option (admittedly not well named, too general), like this:

$("#dialog").dialog({ show: 'fade' });

The close animation is the matching hide option, for example:

$("#dialog").dialog({ show: 'fade', hide: 'drop' });

You can give it a try here

like image 86
Nick Craver Avatar answered Nov 15 '22 14:11

Nick Craver


You could define show and hide as objects which will give you access to more options:

$("#element").dialog({
    show: {
        effect: 'fade',
        duration: 200 //at your convenience
    },
    hide: {
        effect: 'fade',
        duration: 200 //at your convenience
    }
});
like image 23
vivanov Avatar answered Nov 15 '22 15:11

vivanov