magnificpopup - Adding a custom close icon

Issues related to forms.
Post Reply
drooper
 
 
Posts: 9
Joined: Tue Jan 24, 2017 4:43 pm
Location: England

magnificpopup - Adding a custom close icon

Post by drooper »

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.
User avatar
Pablo
 
Posts: 22472
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: magnificpopup - Adding a custom close icon

Post by Pablo »

I'm sorry, I cannot help you to cusomize the code.
User avatar
BaconFries
 
 
Posts: 5640
Joined: Thu Aug 16, 2007 7:32 pm

Re: magnificpopup - Adding a custom close icon

Post by BaconFries »

Forum member rogerl posted his solution on GitHub see the following url Note for information only
https://github.com/dimsemenov/Magnific- ... ssues/1041
There is also an extension by forum member jordan
viewtopic.php?f=42&t=72671
drooper
 
 
Posts: 9
Joined: Tue Jan 24, 2017 4:43 pm
Location: England

Re: magnificpopup - Adding a custom close icon

Post by drooper »

Ok Pablo, thanks anyhow.

Thank you for that BF - I'll take a look.

If I manage to solve it, I'll post back.

Cheers.
Post Reply