One click to scroll back to the top of the webpage.
JavaScript CSS
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.


A scrollToTop jQuery Plugin

How to use:

  1. Include necessary JS files

    <script src="jquery.js"></script>
    <script src="jquery.scrollToTop.min.js"></script>
  2. Add scrollToTop CSS file

    <link rel="stylesheet" href="style.css" />
  3. Create a link element

    <a href="#top" id="toTop"></a>
  4. Fire plugin using jQuery selector

    $(function() {
  5. Option: pass in a number to control scroll speed. Default: 800.

    $(function() {


  • IE7 and above, Firefox, Chrome, Safari and Opera

Live Demo:


Released under the MIT license.