magnificpopup - Adding a custom close icon
Posted: Sun Mar 21, 2021 5:31 pm
Hello everybody.
I'm using magnificpopup to display a contact form, which works as expected.
But to personalise the popup, I'm trying to add my own custom close functionality using a material icon on the form.
In the icon's properties, I added an "onclick" event to run the following javascript (as described in the magnificpopup documentation):
$.magnificPopup.close();
However, when the icon is clicked, nothing happens and the following error is generated:
Uncaught ReferenceError: $ is not defined at HTMLAnchorElement.onclick
My javascript/jquery skills are pretty basic. So to stop me from pulling out what little hair I have left, help from anybody who has managed to achieve this (or is willing to achieve this) would be much appreciated.
Cheers.
I'm using magnificpopup to display a contact form, which works as expected.
But to personalise the popup, I'm trying to add my own custom close functionality using a material icon on the form.
In the icon's properties, I added an "onclick" event to run the following javascript (as described in the magnificpopup documentation):
$.magnificPopup.close();
However, when the icon is clicked, nothing happens and the following error is generated:
Uncaught ReferenceError: $ is not defined at HTMLAnchorElement.onclick
My javascript/jquery skills are pretty basic. So to stop me from pulling out what little hair I have left, help from anybody who has managed to achieve this (or is willing to achieve this) would be much appreciated.
Cheers.