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.

Read Also:  sticky Scroll Back to Top Button using jQuery and CSS

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.

Read Also:  html em tag Attributes

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.

About Pakainfo

I am Jaydeep Gondaliya, a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Pakainfo →

Leave a Reply

Your email address will not be published. Required fields are marked *