1

I'm in D7

I open a simple dialog window with the simple dialog module, and i want to close the dialog programmatically.

I've tried this

// not working !
jQuery('#simple-dialog-container').dialog('close'); 

and this

jQuery(document).find('div.ui-dialog').remove();
jQuery(document).find('div.ui-widget-overlay').remove();
//This seems to work because the window disappears, but I can not open it again.

The X icon on the top-right do this proprely, but i can't catch the action

Thank you for help

1
  • Because its already in an iframe, you need to find another way to do that. Like injecting js to iframe, may be drupal have a way, and i dont now that.
    – niksmac
    Commented Mar 8, 2013 at 14:33

2 Answers 2

1

try this code using jquery,

jQuery('#simple-dialog-container').trigger('click'); 

change id/class to anchor.

0
0

Thanks monymirza, it works !

jQuery('.ui-icon-closethick').trigger('click');
//or
//jQuery('.ui-icon-closethick').click();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.