[jQuery] Re: jquery dialog - close if clicking outside dialog area?

2009-06-02 Thread Gustavo Salomé
Sure. $('body').click(function(){ $('dialog.selector').dialog( 'close' ); }); 2009/6/2 Dennis Morgan > Is it possible to have the jquery ui dialog close when clicking outside the > area of the dialog? Like facebox? Thanks. -- Gustavo Salome Silva

[jQuery] Re: jquery dialog - close if clicking outside dialog area?

2009-06-02 Thread Jonathan
$(document).bind('click', function() { $('#dialog_id').dialog('close'); }); Something like this should do it, although you're going to want to put some checks to test if you're clicking on the something within the dialog so it doesn't close erroneously. And you may also want to only bind the ev