Hello,
I am using a JQuery dialog field. If it is open, I want to do one thing. If it is closed, I want to do another. My question is, how do I detect if a JQuery dialog box is open or not?
Thank you,
Hello,
I am using a JQuery dialog field. If it is open, I want to do one thing. If it is closed, I want to do another. My question is, how do I detect if a JQuery dialog box is open or not?
Thank you,
If you want to check if the dialog's open on a particular element you can do this:
if($("#elem").closest('.ui-dialog').is(':visible')) {
//do something
}
Or if you just want to check if the element itself is visible you can do:
if($("#elem").is(':visible')) {
//do something
}
Or...
if($("#elem:visible").length) {
//do something
}