Last active
December 26, 2022 13:20
-
-
Save karamansky/ebf824b0afc8af8506d7e1cc37f05e19 to your computer and use it in GitHub Desktop.
JS: ArcticModal попап окно
This file contains hidden or 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
<div style="display: none;"> | |
<div id="popup-callback" class="box-modal popup popup-callback"> | |
<div class="box-modal_close arcticmodal-close">×</div> | |
</div> | |
</div> | |
<link rel="stylesheet" href="libs/jquery.arcticmodal-0.3/jquery.arcticmodal-0.3.css"> | |
<script src="libs/jquery.arcticmodal-0.3/jquery.arcticmodal-0.3.min.js"></script> | |
<script> | |
//клик по ссылке открывает попап. В href ссылки должен быть ID нужного попапа | |
$('.open-popup').on('click', function(e){ | |
e.preventDefault(); | |
var id = $(this).attr('href'); | |
if(id != '' && id != '#'){ | |
$(id).arcticmodal(); | |
}else{ | |
console.log('Укажите в ссылке идентифкатор попап окна'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment