How To Create Scroll Top In JQuery?

View: 426    Dowload: 0   Comment: 0   Post by: hanhga   Category: HTML-CSS template   Fields: Other

File has been tested

Example:

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
 
<script>
 $(document).ready(function(){
 $(window).scroll(function(){
 if ($(this).scrollTop() > 100)
 $('.scrollToTop').show();
 else
 $('.scrollToTop').hide();
 });
 $('.scrollToTop').click(function(){
 $('html, body').animate({scrollTop : 0},250);
 return false;
 });
 });
</script>
 
<style>
.scrollToTop {
 position: fixed;
 bottom: 3px;
 right: 25px;
 display:none; 
 cursor:pointer; 
 }
</style>
 
<body>
<h3> Please scroll down to see effect </h3>
 <span style="float:right"> 
 <button type="button" class="scrollToTop">
 Go TO Top 
 </button>
 </span>
 <br><br><br><br><br><br><br><br>
 <br><br><br><br><br><br><br><br>
 <br><br><br><br><br><br><br><br>
 <br><br><br><br><br><br><br><br>
 <br><br><br><br><br><br><br><br>
 <br><br>
</body>
?
 

How To Create Scroll Top In JQuery?

How To Create Scroll Top In JQuery.

Posted on 31-08-2016 

Comment:

To comment you must be logged in members.

Files with category

 
File suggestion for you
File top downloads
Codetitle.net - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.net Develope by Vinagon .Ltd