CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Help with closing Jquery dialog (http://www.codingforums.com/showthread.php?t=259837)

scottlafoy 05-03-2012 07:58 PM

Help with closing Jquery dialog
 
I have a jquery dialog that contains a few fields the close button and some images. When I press the close button or 'X' it works as expected. What I am trying to do is when the dialog is showing and the user clicks on one of the images it runs some javascript and in this javascript I also want to close the dialog.

I am trying:
Code:

$('#dialog-content').dialog('close');
from the function that is being called outside of the dialog. and the function does what it is supposed to but the dialog never closes.

The id of the div i am running as a dialog is 'dialog-content'.

Any suggestions?

sunfighter 05-04-2012 01:44 PM

try putting $('#dialog-content').dialog('close'); as your first line in your javascript.

scottlafoy 05-04-2012 04:26 PM

That is it. I didn't think that would work as I have nothing called Dialog-content on the screen. Glad it seems to only close the front most dialog box. Thank you for your reply!


All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.