Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI: dialog show/hide effects with options

Tags:

Is it possible to specify options for the show and hide options of a Dialog box in jQuery UI.

For example, instead of:

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

Something like:

$('#dialog').dialog({   show: {effect: 'fade', speed: 1000} }); 

(The code above does not, of course, work.)

What I'm really trying to use is the "complete" method inside of the effect, or a callback function, so I can select some text after the effect is done.

If anyone knows, thanks.

like image 391
eje211 Avatar asked Oct 17 '10 02:10

eje211


1 Answers

I don't know how to specify all the options, but I did manage to specify the speed, which is the option you have in your example. I did this as follows:

$('#dialog').dialog({ show: {effect: 'fade', duration: 250} hide: {effect: 'fade', duration: 5000} }); 

duration is the number of milliseconds that the animation will last. I found this out by stepping through the javascript with firebug.

like image 101
Ol'timer Avatar answered Oct 26 '22 05:10

Ol'timer