Smooth Scroll to Top with jQuery

Today, We want to share with you Smooth Scroll to Top with jQuery.In this post we will show you How To Create a Scroll Back To Top Button, hear for jQuery: Scroll to the top of the page we will give you demo and example for implement.In this post, we will learn about Scroll to the top of the page using JavaScript/jQuery with an example.

Read Also:  JavaScript isNaN Function Example with demo

Smooth Scroll to Top with jQuery

There are the Following The simple About Smooth Scroll to Top with jQuery Full Information With Example and source code.

As I will cover this Post with live Working example to develop javascript scroll to top of div, so the jQuery Smooth Animated Scroll to Top of page example is following below.

Scroll to top JQuery

$(document).ready(function(){    
    $('.TopOfScrollBar').click(function(){
        $('html, body').animate({scrollTop : 0},700);
        return false;
    });
});

using Class

$(window).scroll(function(){
        if ($(this).scrollTop() > 120) {
            $('.TopOfScrollBar').fadeIn();
        } else {
            $('.TopOfScrollBar').fadeOut();
        }
    });

Simple Scroll to top JQuery script

$(document).ready(function(){    
        $(window).scroll(function(){
        if ($(this).scrollTop() > 120) {
            $('.TopOfScrollBar').fadeIn();
        } else {
            $('.TopOfScrollBar').fadeOut();
        }
    });
 
    $('.TopOfScrollBar').click(function(){
        $('html, body').animate({scrollTop : 0},700);
        return false;
    });
 
});

Web Programming Tutorials Example with Demo

Read :

Read Also:  Laravel Combine multiple queries Tutorials

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Smooth Scroll to Top with jQuery.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  How to Find the Document Root using PHP Script
  2. Read Also:  ng-if Condition using Angular Example
  3. Read Also:  jQuery An Animated Scroll To Top Button
  4. Read Also:  Angular 6 and ASP.NET Core 2.0 Web API Example
  5. Read Also:  CodeIgniter JQuery Ajax Request Example
  6. Read Also:  sticky Scroll Back to Top Button using jQuery and CSS
  7. Read Also:  ng-keydown Event using Angular Example
  8. Read Also:  download csv file in php example
  9. Read Also:  Simple Jquery Scroll To Top Example
  10. Read Also:  jQuery Back to top