One click to scroll back to the top of the webpage.
Switch branches/tags
Nothing to show
Clone or download
Latest commit a5e700a Apr 28, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes scrollToTop src and example Mar 15, 2013
.gitignore scrollToTop src and example Mar 15, 2013
README.md Update README.md Apr 28, 2015
jquery.scrollToTop.js scrollToTop src and example Mar 15, 2013
jquery.scrollToTop.min.js scrollToTop src and example Mar 15, 2013
scrollToTop.jquery.json Update demo Oct 25, 2013
style.css Update demo Oct 25, 2013

README.md

scrollToTop

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() {
    	$("#toTop").scrollToTop();
    });
    
  5. Option: pass in a number to control scroll speed. Default: 800.

    $(function() {
    	$("#toTop").scrollToTop(1000);
    });
    

Compatibility:

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

Live Demo:

License:

Released under the MIT license.