I asked this the other day and Zack wrote a snippet for closing 1 popup. Now I need to close 2.
I tried modifying the snippet, but can’t get it to work
close_popup = function(){ var popup_array = skuid.$(‘.ui-dialog-content’);
for (i = 0; i < popup_array.length; i++){
popup_array i].dialog(‘destroy’);
popup_array };
i do get the array, which appears to have dom elements in it, but i get “undefined is not a function” when i try and call destroy
do i have to somehow transform the array item into something jquery can call ‘dialog’ on ?
Page 1 / 1
This will close, destroy, and remove all open popups on the screen:
skuid.$(‘.ui-dialog-content’).dialog(‘close’);
Thanks Zach,
I was trying to hard, I guess.
Ken
Is there an easy way to have it close the window as well?
#mustlearnjavascript
#Ihatedumbquestions
Is there a way to close two out of three popups on a page?
I tried this but it didn’t work:
var pop1 = skuid.$('.ui-dialog-content')'1]; var pop2 = skuid.$('.ui-dialog-content')'2];<br>pop1.dialog('close');<br>pop2.dialog('close');
Figured out a solutions. Not sure if its the best way:
https://api.jqueryui.com/dialog/ helped a lot.
$.each(skuid.$('.ui-dialog-content'), function(i, row){ <br> if(i==2 || i==1){<br> <br> var UIiD = "#"+this.id;<br> skuid.$(UIiD).dialog('close');<br> <br> }<br> <br>});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.