Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,762
    Thanks
    23
    Thanked 546 Times in 545 Posts
    try putting $('#dialog-content').dialog('close'); as your first line in your javascript.

  • Users who have thanked sunfighter for this post:

    scottlafoy (05-04-2012)

  • #3
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •