views:

16

answers:

1

How does one close all jquery ui dialog windows in javascript?

Situation:

The page has multiple things that can be opened using the dialog boxes. I need a way to close all previous windows before opening a new one.

+3  A: 

They all have the .ui-dialog-content class, so select by that and close them, like this:

$(".ui-dialog-content").dialog("close");
Nick Craver
Thank you. I don't know how I've missed that.
Matthew Rygiel