Back to Top Button using jQuery and CSS – Scroll to Top Example

Back to Top Button using jQuery and CSS – Scroll to Top Example

In this Post We Will Explain About is Back to Top Button using jQuery and CSS – Scroll to Top Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to jQuery Back to top Plugins Example

In this post we will show you Best way to implement CSS and jQuery Back to top, hear for How To Create a Scroll Back To Top Button with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Creating a Back to Top Button with CSS & jQuery

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

Also Read :  jquery replace newline with br Example - Convert new lines to br - nl2br function

Include External libs

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

index.html

<body>
<div class="container"> 
<a href="javascript:void(0);" id="live_scroll" title="Scroll to Top" style="display: none;">Top<span></span></a>

	<div class="well">
	<h1>How To Create a Scroll Back To Top Button</h1>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.
	</div>
</div>
</body>

index.js

$(document).ready(function(){ 
    $(window).scroll(function(){ 
        if ($(this).scrollTop() > 100) { 
            $('#live_scroll').fadeIn(); 
        } else { 
            $('#live_scroll').fadeOut(); 
        } 
    }); 
    $('#live_scroll').click(function(){ 
        $("html, body").animate({ scrollTop: 0 }, 600); 
        return false; 
    }); 
});

Also Read :  Angularjs Show Hide Password in Password TextBox with CheckBox

style.css

#live_scroll {
    position:fixed;
    right:10px;
    bottom:10px;
    cursor:pointer;
    width:50px;
    height:50px;
    background-color:#1565c0;
    text-indent:-9999px;
    display:none;
    -webkit-border-radius:60px;
    -moz-border-radius:60px;
    border-radius:60px
}
#live_scroll span {
    position:absolute;
    top:50%;
    left:50%;
    margin-left:-8px;
    margin-top:-12px;
    height:0;
    width:0;
    border:8px solid transparent;
    border-bottom-color:#ffffff
}
#live_scroll:hover {
    background-color:#000;
    opacity:1;filter:"alpha(opacity=100)";
    -ms-filter:"alpha(opacity=100)";
}

You are Most welcome in my youtube Channel Please shubscibe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is How To Create a Scroll Back To Top Button And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Reply

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