Remove navbar requirement for js-scroll-trigger to collapse responsive nav when clicked
This commit is contained in:
parent
51186ab557
commit
223a036b8d
@ -16,7 +16,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Closes responsive menu when a scroll trigger link is clicked
|
// Closes responsive menu when a scroll trigger link is clicked
|
||||||
$('.navbar .js-scroll-trigger').click(function() {
|
$('.js-scroll-trigger').click(function() {
|
||||||
$('.navbar-collapse').collapse('hide');
|
$('.navbar-collapse').collapse('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
js/agency.min.js
vendored
2
js/agency.min.js
vendored
@ -3,4 +3,4 @@
|
|||||||
* Copyright 2013-2017 Start Bootstrap
|
* Copyright 2013-2017 Start Bootstrap
|
||||||
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-agency/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-agency/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
!function(a){"use strict";a('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=a(this.hash);if((e=e.length?e:a("[name="+this.hash.slice(1)+"]")).length)return a("html, body").animate({scrollTop:e.offset().top-54},1e3,"easeInOutExpo"),!1}}),a(".navbar .js-scroll-trigger").click(function(){a(".navbar-collapse").collapse("hide")}),a("body").scrollspy({target:"#mainNav",offset:54}),a(window).scroll(function(){a("#mainNav").offset().top>100?a("#mainNav").addClass("navbar-shrink"):a("#mainNav").removeClass("navbar-shrink")})}(jQuery);
|
!function(a){"use strict";a('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=a(this.hash);if((e=e.length?e:a("[name="+this.hash.slice(1)+"]")).length)return a("html, body").animate({scrollTop:e.offset().top-54},1e3,"easeInOutExpo"),!1}}),a(".js-scroll-trigger").click(function(){a(".navbar-collapse").collapse("hide")}),a("body").scrollspy({target:"#mainNav",offset:54}),a(window).scroll(function(){a("#mainNav").offset().top>100?a("#mainNav").addClass("navbar-shrink"):a("#mainNav").removeClass("navbar-shrink")})}(jQuery);
|
Loading…
Reference in New Issue
Block a user