Skip to content

Instantly share code, notes, and snippets.

@karamansky
Last active December 26, 2022 13:20
Show Gist options
  • Save karamansky/ebf824b0afc8af8506d7e1cc37f05e19 to your computer and use it in GitHub Desktop.
Save karamansky/ebf824b0afc8af8506d7e1cc37f05e19 to your computer and use it in GitHub Desktop.
JS: ArcticModal попап окно
<div style="display: none;">
<div id="popup-callback" class="box-modal popup popup-callback">
<div class="box-modal_close arcticmodal-close">&times;</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