rajudhaka

Back to top button

Jul 27th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // HTML mark up
  2. <a class="back-to-top"><i class="fa fa-arrow-up"></i></a>
  3.  
  4. // Add this to JavaScript file
  5. jQuery(function ($) {
  6.     var $buttonTop = $('.back-to-top');
  7.  
  8.     $buttonTop.on('click', function () {
  9.       $('html, body').animate({
  10.         scrollTop: 0,
  11.       }, 1000);
  12.     });
  13.   });
Advertisement
Add Comment
Please, Sign In to add comment