(^412) ❘ CHAPTER 17 DIALOG
autoOpen : false,
resizable : false,
draggable : false
});
$('input#exampleDialogOpen').click(
function(event)
{
event.preventDefault();
$('div#exampleDialog')
.dialog('open');
}
);
}
);
Animating the Dialog
Opening or closing a dialog can also be animated using one of the effects listed in Appendix M,
“Effects.” Animation can be introduced by providing an effect to the show option.The following script, Example 17-7, demonstrates how to do this:
$(document).ready(
function()
{
$('div#exampleDialog').dialog({
title : 'Example Dialog',
modal : true,
autoOpen : false,
resizable : true,
draggable : true,
show : 'explode'
});$('input#exampleDialogOpen').click(
function(event)
{
event.preventDefault();$('div#exampleDialog')
.dialog('open');
}
);
}
);The preceding script applies an animation upon opening the dialog using the jQuery explode effect.
Figure 17-5 captures the explode effect mid-animation.