Tuesday, January 8, 2013

Closing the JQuery UI Dialog by the UI Generated Class

The JQuery UI Dialog box creates a bunch of classes to surround the div you coded to act as the modal window.  One of these classes is the ui-dialog-content class. The neat thing about this class is that it is responds to the dialog methods, so if you want to close it and for whatever reason you don't know what div/element you might be in (separate template file perhaps), you can call:

$(".ui-dialog-content").dialog("close");

More info is available here.

No comments:

Post a Comment