Skip to content

Closing the alerts popup when clicking outside

euantor edited this page Nov 11, 2012 · 2 revisions

The below code can be added to your myalerts.js file (for jQuery users as per the MyAlerts standard) to allow the popup menu to be closed by simply clicking outside it:

$("body:not('.myalerts_popup:visible')").on('click', function() {
    $('.myalerts_popup:visible').slideToggle("fast");
});