High Performance Scroll To Top Plugin – ScrollTop-JS

Category: Animation , Javascript | December 3, 2017
Author:HaiBach
Views Total:596 views
Official Page:Go to website
Last Update:December 3, 2017
License:MIT

Preview:

High Performance Scroll To Top Plugin – ScrollTop-JS

Description:

ScrollTop-JS is a lightweight JavaScript back to top plugin which provides the smooth, high-performance scroll to top animation using the window.requestAnimationFrame() API.

Basic usage:

Create a scroll to top button at the bottom of your main content.

<a id="scrolltop" href="#">Top</a>

Download and load the JavaScript file ‘scrolltop.js’ in the document when needed.

<script src="scripts/scrolltop.js"></script>

That’s it. Feel free to customize the scroll to top button in the CSS.

#scrolltop {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  background-color: #C1272D;
  border-radius: 4px;
  color: #fff;
  line-height: 50px;
  text-decoration: none;
  text-align: center;
}

You Might Be Interested In:


Leave a Reply