Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-03-2012, 07:58 PM   PM User | #1
scottlafoy
New to the CF scene

 
Join Date: Apr 2012
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
scottlafoy is an unknown quantity at this point
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?
scottlafoy is offline   Reply With Quote
Old 05-04-2012, 01:44 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,376
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
try putting $('#dialog-content').dialog('close'); as your first line in your javascript.
sunfighter is offline   Reply With Quote
Users who have thanked sunfighter for this post:
scottlafoy (05-04-2012)
Old 05-04-2012, 04:26 PM   PM User | #3
scottlafoy
New to the CF scene

 
Join Date: Apr 2012
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
scottlafoy is an unknown quantity at this point
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!
scottlafoy is offline   Reply With Quote
Reply

Bookmarks

Tags
asp, dialog, javascript, jquery

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:24 AM.


Advertisement
Log in to turn off these ads.