Line 986: | Line 986: | ||
$( document ).ready(function() { $("body").scrollspy({target: "#myScrollspy", offset:200}); }); | $( document ).ready(function() { $("body").scrollspy({target: "#myScrollspy", offset:200}); }); | ||
// Add smooth scrolling on all links inside the navbar | // Add smooth scrolling on all links inside the navbar | ||
− | $('body').on('click','a[href | + | $('body').on('click','a[href*="#nav"]',function(event){ |
event.preventDefault(); | event.preventDefault(); | ||
var target_offset = $(this.hash).offset() ? $(this.hash).offset().top : 0; | var target_offset = $(this.hash).offset() ? $(this.hash).offset().top : 0; | ||
//change this number to create the additional off set | //change this number to create the additional off set | ||
− | var customoffset = | + | var customoffset = 100 |
$('html, body').animate({scrollTop:target_offset - customoffset}, 500); | $('html, body').animate({scrollTop:target_offset - customoffset}, 500); | ||
}); | }); |
Revision as of 14:07, 28 October 2017