Hot File

How To Create Scroll Top In JQuery?

View: 257    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: HTML-CSS template   Fields: Other

0 point/1 review File has been tested

How To Create Scroll Top In JQuery.

Introduction

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  How To Create Scroll Top In JQuery. 5/10 257

Comment:

To comment you must be logged in members.

Files with category

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd