Web Development with jQuery®

(Elliott) #1

Working with Dialog Events (^) ❘ 413


FIGURE 17-5


Appendix P, “Dialog,” provides a complete list of options that can be provided to the show option.


Working with Dialog Events


The Dialog plugin supports a variety of events. You can set up events that are executed when the
dialog is opened, when the dialog is focused, when the dialog is resized, when the dialog is dragged,
or when the dialog is closed. The following document, Example 17-8, demonstrates attaching close
and open events to the dialog, but a full list of events is available in Appendix P:

$(document).ready(
function()
{
$('div#exampleDialog').dialog({
title : 'Example Dialog',
modal : true,
autoOpen : false,
resizable : true,
draggable : true,
show : 'explode',
close : function(event, ui)
{
alert('Dialog Closed');
},
open : function(event, ui)
{
alert('Dialog Opened');

http://www.it-ebooks.info

Free download pdf