Created
September 8, 2017 03:06
-
-
Save qwersk/5bbaf44a7cb235a4bb8bf15e9a3e84a2 to your computer and use it in GitHub Desktop.
Magnific popup on click event #JS #JQUERY #MAGNIFIC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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