inside out project STEP-501 to STEP-502 scrolling-nav.js Code Changes

Created Diff never expires
2 removals
22 lines
2 additions
22 lines
(function ($) {
function startScroll() {
"use strict";
"use strict";
$('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function () {
$('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function () {
if (location.pathname.replace(/^/ / , '') == this.pathname.replace(/^/ / , '') && location.hostname == this.hostname) {
if (location.pathname.replace(/^/ / , '') == this.pathname.replace(/^/ / , '') && location.hostname == this.hostname) {
var target = $(this.hash);
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
if (target.length) {
$('html, body').animate({
$('html, body').animate({
scrollTop: (target.offset().top - 54)
scrollTop: (target.offset().top - 54)
}, 1000, "easeInOutExpo");
}, 1000, "easeInOutExpo");
return false;
return false;
}
}
}
}
});
});
$('.js-scroll-trigger').click(function () {
$('.js-scroll-trigger').click(function () {
$('.navbar-collapse').collapse('hide');
$('.navbar-collapse').collapse('hide');
});
});
$('body').scrollspy({
$('body').scrollspy({
target: '#mainNav',
target: '#mainNav',
offset: 54
offset: 54
});
});
})(jQuery);
};