Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if a jQuery UI dialog box is open

I am using a jQuery UI dialog. 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 UI dialog box is open or not?

like image 524
user208662 Avatar asked Jul 22 '10 21:07

user208662


People also ask

What is jQuery UI dialog?

The jQuery UI dialog method is used to create a basic dialog window which is positioned into the viewport and protected from page content. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.

What is a dialog box in UI?

A dialog is a type of modal window. Access to the rest of the UI is disabled until the modal is addressed. All modal surfaces are interruptive by design – their purpose is to have the user focus on content on a surface that appears in front of all other surfaces.


1 Answers

If you read the docs.

$('#mydialog').dialog('isOpen') 

This method returns a Boolean (true or false), not a jQuery object.

like image 172
Byron Whitlock Avatar answered Sep 19 '22 05:09

Byron Whitlock