Download
1. INCLUDE JS FILES
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="jquery.toTop.min.js"></script>
2. HTML
<a class="to-top">Top ↑</a>
3. JAVASCRIPT
$('.to-top').toTop();
4. OPTIONS
Option |
Value |
Desciption |
autohide |
boolean |
You have options whether you want your button to hide automatically or not. You can choose 'true' or 'false'. default: true |
offset |
Integer (px) |
Scrolling length from top to hide automatically. default: 420 |
speed |
Integer (ms) |
The duration for scroll and fade speed. default: 500 |
right |
Integer (px) |
Position from right. default: 15 |
bottom |
Integer (px) |
Position from bottom. default: 30 |
Plugin activation with options
$('.to-top').toTop({
//options with default values
autohide: true,
offset: 420,
speed: 500,
right: 15,
bottom: 30
});