nunta/js/agency.min.js
David Miller 03818fa17a Merge pull request #116 from brouillon/brouillon-patch-1
Collapse navbar if page is not at top on load
2017-10-20 18:26:08 -04:00

7 lines
920 B
JavaScript

/*!
* Start Bootstrap - Agency v4.0.0-beta.2 (https://startbootstrap.com/template-overviews/agency)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-agency/blob/master/LICENSE)
*/
(function(b){b('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var c=b(this.hash);c=c.length?c:b("[name="+this.hash.slice(1)+"]");if(c.length){b("html, body").animate({scrollTop:(c.offset().top-54)},1000,"easeInOutExpo");return false}}});b(".js-scroll-trigger").click(function(){b(".navbar-collapse").collapse("hide")});b("body").scrollspy({target:"#mainNav",offset:54});var a=function(){if(b("#mainNav").offset().top>100){b("#mainNav").addClass("navbar-shrink")}else{b("#mainNav").removeClass("navbar-shrink")}};a();b(window).scroll(a)})(jQuery);