Sha256: e7ab036b31f3ff6a702a885b35708674aa59f19d3f7ee6b7e4a8a62622ac1b72

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

(function($) {
    "use strict"; // Start of use strict

    // Smooth scrolling using jQuery easing
    $('a[href*="#"]:not([href="#"])').click(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
            var target = $(this.hash);
            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
            if (target.length) {
                $('html, body').animate({
                    scrollTop: (target.offset().top - 48)
                }, 1000, "easeInOutExpo");
                return false;
            }
        }
    });

    // Activate scrollspy to add active class to navbar items on scroll
    $('body').scrollspy({
        target: '#mainNav',
        offset: 54
    });

    // Closes responsive menu when a link is clicked
    $('.navbar-collapse>ul>li>a').click(function() {
        $('.navbar-collapse').collapse('hide');
    });

    // Collapse the navbar when page is scrolled
    $(window).scroll(function() {
        if ($("#mainNav").offset().top > 10) {
            $("#mainNav").addClass("navbar-shrink");
        } else {
            $("#mainNav").removeClass("navbar-shrink");
        }
    });

})(jQuery); // End of use strict

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
codebuild-0.6.3 docs/js/new-age.js
codepipeline-0.3.0 docs/js/new-age.js
codebuild-0.6.2 docs/js/new-age.js
codepipeline-0.2.1 docs/js/new-age.js
codepipeline-0.2.0 docs/js/new-age.js
codebuild-0.6.1 docs/js/new-age.js
codebuild-0.6.0 docs/js/new-age.js