mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-13 00:39:45 +00:00
22 lines
597 B
JavaScript
22 lines
597 B
JavaScript
// Bitty scrolling links script
|
|
$('a[href^="#"]').click(function(e) {
|
|
e.preventDefault();
|
|
$('html, body').animate({
|
|
scrollTop: $(this.hash).offset().top
|
|
}, 500);
|
|
$("#nav-menu").removeClass("is-active");
|
|
return true;
|
|
})
|
|
|
|
// Modal closer
|
|
$('.card').click(function () {
|
|
$('#'+this.id+'.modal').addClass('is-active');
|
|
});
|
|
$('.modal-close').click(function () {
|
|
$('#'+$(this).parent('.modal').get(0).id+'.modal').removeClass('is-active');
|
|
});
|
|
$(document).keypress(function(e) {
|
|
if(e.which == 0) {
|
|
$('.modal.is-active').removeClass('is-active');
|
|
}
|
|
});
|