Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « js « static - github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 195ad57cdf1879d63cbeabaaad12422def2de4b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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).attr('data-target')).addClass('is-active');
});
$('.modal-close').click(function () {
    $($(this).attr('data-target')).removeClass('is-active');
});
$(document).keypress(function(e) {
    if(e.which == 0) {
        $('.modal.is-active').removeClass('is-active');
    }
});