Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using modalframe and automodal (which automatically creates modalframes from a css class on a link).
My request is more related to modalframes I believe.
I would like to close the modalframe, by just clicking on the area around the modalframe (in other words, by clicking on any spot outside the modalframe).
I googled "jquery and close dialogs" and found this piece of code:
$('.ui-widget-overlay').live('click', function() {
$(".dialogClass").dialog( "close" );
});
I tried to add this to ui.dialogs.js which didn't work, unfortunately.
How could I close modalframes by clicking outside them?
Comments
Comment #1
dsnopekRather than calling
$(".dialogClass").dialog( "close" );
callDrupal.modalFrame.close()
. I hope that helps!