kswedberg / jquery-smooth-scroll

Automatically make same-page links scroll smoothly
MIT License
1.97k stars 427 forks source link

The issue with the substitute symbol. I can't figure it out. #111

Open alexey-saransk opened 6 years ago

alexey-saransk commented 6 years ago

Hi bro https://yadi.sk/d/UfBZbjUPJcD3Kw - example

In this example, I want to remove the slash "/". It is necessary that after the " # "was not"/", and everything else should remain the same. I'm a very bad programmer. Please help me.

kswedberg commented 5 years ago

Hi,

You can do that pretty easily, but you'll lose smooth scrolling on page reload and when using the back button.

In your example, replace everything inside the $(document).ready() callback with this:

  $('.smooth_sc').smoothScroll({
     afterScroll: function() {
        location.hash = this.hash;
     }
  });