Search
Other Modals questions
Forum

Custom close button

Frans van Bragt's Avatar Frans van Bragt
I need to add a custom close button to replace the standard close function.
Modals is set to autoconvert links that contain a certain text, this works fine.

However I cannot get the JS trigger to work. The documentation gives a Jquery JS code which is outdated with Joomla4.

In the text of the article in the modal I have a line of code for the custom close button:
The code I tried to use:
<p><a class="btn btn-danger" onclick="RegularLabs.Modals.close();">Terug naar overzicht</a></p>
<p><a class="btn btn-danger" onclick="parent.RegularLabs.Modals.close();">Terug naar overzicht</a></p>
<p><a class="btn btn-danger" onclick="RegularLabs.Modals.close(this);">Terug naar overzicht</a></p>
In all cases I get a JS error: Uncaught (in promise) TypeError: element.classList is undefined

What am I doing wrong?

Thanks
Peter van Westen's Avatar Peter van Westen ADMIN
What version of Joomla are you using?
Do you have this online so I can take a look?
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription