Scroll Down To Show The Anchor Link To Go To The Top With The Animation

Scroll down to show the anchor link to go to the top with the animation. It is the simplest implementation of a smooth back-to-top functionality using jQuery, JavaScript, and CSS/CSS3.

animated scroll to top button codepen, back to top scroll animation, back to top examples, back to top button pure javascript, scroll to top script, vanilla js back to top

A JavaScript Library to Display Link/URL Preview On Hover | Hyperlinks

How to make use of it:

1. Create an anchor link for the back to top button.

<a href="#myAnchor" class="go-top">
  Icon, Text, Button, etc...

2. CSS is required to position the back to the top button.

.go-top {
  display: block;
  width: 40px;
  height: 40px;
  line-height: 35px;
  text-align: center;
  font-size: 30px;
  position: fixed;
  bottom: -40px;
  right: 20px;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
  background-color: #404040;
  color: #FFFFFF;
  text-decoration: none;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
} { bottom: 20px; }

.go-top:hover {
  background-color: #5DBA9D;
  color: #FFFFFF;

3. Load the required jQuery JavaScript library at the end of the document.

<script src="//"></script> 

4. Javascript to add/remove CSS classes to back button up when scrolling down/up.

  var scroll = $(window).scrollTop();
    if (scroll >= 50) {
    } else {

5. Smoothly scroll the window back to the top of your webpage when you click the back-to-top button.

  $('html, body').animate({
    scrollTop: $( $(this).attr('href') ).offset().top
  }, 1000);

Minimal Back To Top Functionality with jQuery and CSS3 Plugin/Github, back to top plugin, back to top smooth scroll jquery

See Demo And Download

Official Website(mattiabericchia): Click Here

This superior jQuery/javascript plugin is developed by mattiabericchia. For extra Advanced Usages, please go to the official website.

Related Posts


A Simple Searchable Select Dropdown Plugin | jQuery Select Search

Simple jQuery search on the selection options plugin for your website. Next, there is a checkbox replacement plugin that refines and beautifies the original selection element with…


A Quick jQuery-Based Country Picker With Flags | Country Select JS

Country Select JS is a jQuery plugin to select a country, based on the international phone input plugin. Adds a flag dropdown to any input, which lists…


Simple and Fast Autocomplete and Typeahead Javascript Library | autoComplete.js

autoComplete.js is a simple, pure, and incrementally designed JavaScript library for speed, high versatility, and seamless integration with a wide variety of projects and systems. Features Pure…


Bootstrap Notification Message Alert Plugin with jQuery

BootstrapMsg is a jQuery plugin for displaying messages with Bootstrap alert classes to generate hierarchical in-page navigation for an extended webpage sectioned by heading components. Using Bootstrap…


jQuery Plugin for Transforming HTML Tables Into Charts Using Google Charts

Chartinator is a jQuery plugin for converting HTML tables, Google Sheets and js arrays into charts using Google Charts. Use data from HTML tables Chartinator is designed…


Customizable & Composable Charts for VueJS | vue-wcharts

WCharts is a library that makes it easy to create your own charts using Vuejs. You can easily create reusable chart components. Use a basic layout or…