Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created September 8, 2017 03:06
Show Gist options
  • Save qwersk/5bbaf44a7cb235a4bb8bf15e9a3e84a2 to your computer and use it in GitHub Desktop.
Save qwersk/5bbaf44a7cb235a4bb8bf15e9a3e84a2 to your computer and use it in GitHub Desktop.
Magnific popup on click event #JS #JQUERY #MAGNIFIC
function openPopup(el) { // get the class name in arguments here
$.magnificPopup.open({
items: {
src: '#test-modal',
},
type: 'inline'
});
}
$(function () {
$('.ajax-call').click(function (e) {
openPopup(this.className);
});
$(document).on('click', '.closePopup', function (e) {
e.preventDefault();
$.magnificPopup.close();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment