Smooth Scroll to Top with jQuery

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.

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.

  JQUERY Examples Programming Tutorials

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 :

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.

  Check all checkboxes in vuejs

Leave a Reply

avatar
  Subscribe  
Notify of