There are different events during the opening and closing of modals on which you can attach javascript actions.
So if you need to trigger some custom javascript function or something in a 3rd party plugin, you can do that.
The available events are:
on-open
Event that fires right before the modal begins to open.on-load
Event that fires right before attempting to load the target content.on-loaded
Event that fires right after the content has finished loading.on-opened
Event that fires right after the modal is opened.on-close
Event that fires at the start of the close process.on-closed
Event that fires once the modal is closed.
{modal article="My Article" on-open="alert('The modal is opening!');"}Alert when opening{/modal}
{modal article="My Article" on-closed="alert('The modal just closed!');"}Alert when closed{/modal}
{modal article="My Article" on-open="console.log('on-open');" on-load="console.log('on-load');" on-loaded="console.log('on-loaded');" on-opened="console.log('on-opened');" on-close="console.log('on-close');" on-closed="console.log('on-closed');"}See the browsers console{/modal}