<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script type="text/javascript" src="js/function.js"></script>
$(document).ready(function() {
$(".popup").magnificPopup();
});