// Smooth scrolling when clicking on a hash link
jQuery(function( $ ){
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
//Adjust top position when header changes size
if ( $(window).width() > 960) {
var $scrollTop = $target.offset().top-72;
} else {
var $scrollTop = $target.offset().top-81;
}
$('html, body').stop().animate({
'scrollTop': $scrollTop
}, 500, 'swing');
});
});