If the webpage is too long, you usually use the anchor tag to quickly return to the top
<A href = "# Header" Title = "Back to Top"> top </a> is really simple, but some experts make this simple:
Foreign demo address: http://tonyyoo.com/v2/
Clicking the top button does not directly jump to the top of the page, but scroll up .. The longer the page, the faster the scrolling speed...
After research, four JavaScript codes are used:
<SCRIPT type = "text/JavaScript" src = "scripts/prototype. Lite. js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "scripts/moo. FX. js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "scripts/moo. FX. Pack. js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "scripts/pagescroll. js"> </SCRIPT>
It looks complicated .. I wonder if it can be simplified.CodeI can't achieve the same effect ..
After the onload of the page, traverse all the hyperlinks to determine whether there is # header in href. If yes, trigger scrollto...
Xmlns = "http://www.w3.org/1999/xhtml">