Open Tanel-F opened 6 years ago
<button class="bigRed">Go back</button>
$('.bigRed').click(function() {
e.preventDefault();
$.magnificPopup.close();
});
Thank you for the reply. Could you please explain what is the purpose of:
e.preventDefault();
It tells a browser to ignore the event and do not invoke a default handler(s) for it. For instance, in case of clicking on a submit button browser doesn't submit a form.
I'm trying to close the Magnific-Popup page by clicking a button with the following code (unfortunately nothing happens):
<button class="bigRed" onclick="$.magnificPopup.close();">Go back</button>
According to dimsemenov.com/plugins/magnific-popup/documentation.html
$.magnificPopup.close(); // Close popup that is currently opened (shorthand)
I am using the Magnific-Popup code as part of a WordPress portfolio Ajax page, the theme I am using is H-Code by Themezaa. Any feedback is greatly appreciated.