Is there a way to run code when featherlight lightbox is opened? And again when it is closed? Is there a hook or something so that I can run code after the lightbox is opened? I couldn't find examples on the github page (https://github.com/noelboss/featherlight)
Addendum after answer from HBlackorby:
My setup is like this: HTML:
<ul data-featherlight
data-featherlight-type="ajax"
data-featherlight-filter="a.box"
data-featherlight-before-open="MYFUNCTION">
<li><a class="box" href="content1">Link</a></li>
<li><a class="box" href="content2">Link2</a></li>
<li><a class="box" href="content3">Link3</a></li>
</ul>
And in my seperate JavaScript-File I have the following lines of code:
MYFUNCTION = function(){
console.log('Test')
}
Unfortunately this function is not called before opening. Also tried it with "after" instead of "before". I also don't get errors. Where do these lines of code have to be when I call featherlight in the HTML?