brain2002 of Brainlane
2/23/2017 - 12:18 PM

Smooth scroll on # targets and show no hash in the url

Smooth scroll on # targets and show no hash in the url

$('a[href^="#"]').on('click', function (e) {
   e.preventDefault();

   var target = this.hash;
   var $target = $(target);

    $('html, body').animate({
       'scrollTop': $target.offset().top
    }, 500, 'swing');

}); // - end Smooth scroll