javascript - Improve smooth scrolling in order to get anchor links on the URL Adress bar -
as title says, found this script smooth scrolling , improved little, looks this: $('a[href*=#]:not([href=#])').on('click', function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrolltop: target.offset().top - 50 // in case 50px before }, 1000); return false; } } }); it triggers when user click on anchor link. the problem url address doesn't change. i'll change user url address bar, in order anchor link displayed everytime user click on link makes him scroll. thanks in advance give me. ps: can see website i'm testing here . you can change address using: if (target.length) { history.replacestate(n...