kswedberg / jquery-smooth-scroll

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

scroll to the top of the page #107

Open kaji2 opened 7 years ago

kaji2 commented 7 years ago

Hi, I'd like to scroll to the top of the page with the following tag <a href="#"> or <a href="#top">, but there is not smooth animation. Of course, when I wrote <body id="top"> and with <a href="#top">, it works.

According to the specification, href="#top" and href="#"means to link to the top of the page. cf. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

You can use href="#top" or the empty fragment href="#" to link to the top of the current page. This behavior is specified by HTML5.

So, I suggest that it will work without <body id="top">. Thanks.