I'm registering multiple featherlight instances upon page-load
jQuery('.feedback').featherlight(jQuery( "#feedback-box" ), { closeIcon: 'close'});
jQuery('#imprint').featherlight(jQuery( "#imprint-box" ), { closeIcon: 'close'});
When one box is opened I would like to close all other open ones before.
How can I achieve this?
Edit: I tried this but it doesn't work.
$('.feedback').featherlight($( "#feedback-box" ), {
closeIcon: 'close',
beforeOpen: $.featherlight.close()
});
You want
beforeOpen
to be a function...With the code you gave, you will get an error in the console, won't you?
You need to write instead: