|
|
close jquery ui dialog when clicked out side - Javascript
|
Views : 201
|
|
Tagged in : Javascript
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
close jquery ui dialog when clicked out side the dialog box
Add this code on document.ready function,
$(window).click(function(event) {
if (($(event.target).closest('.ui-dialog')).length>0) {
// if clicked on a dialog, do nothing
return false;
}
else if(event.target.id!='your dialog id''){
$('.ui-dialog-content:visible').dialog('close');
}
else {
// if clicked outside the dialog, close it
$('.ui-dialog-content:visible').dialog('close');
}
})
|
|
By Guna, On - 2011-08-12 |
|
|
|