A jQuery plugin to create a customisable 'Back to Top' feature for integration with any website.
To install backTop with Bower:
bower install backTop
-
Include
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
just before the</body>
tag -
Include
<script src="PATH TO YOUR JS DIRECTORY/jquery.backTop.js"></script>
after the jquery include. -
Include
<a id='backTop'>Back To Top</a>
within your html<body></body>
tag -
Include
<link href="css/backTop.css" rel="stylesheet" type="text/css" />
before the</head>
tag.
$(document).ready( function() {
$('#backTop').backTop();
});
Example with default options
$(document).ready( function() {
$('#backTop').backTop({
'position' : 400,
'speed' : 500,
'color' : 'red',
});
});
To set a position of the Scroll Top Icon top appear when the browser scroll reaches at the specified position. Default position is 400px from the Top.
To specify the animation speed of the Scroll Top Icon to appear when the page reaches the scroll position.
To specify the color of the Scroll Top Icon from the 4 (Four) predefined colors. - black, white, red, green
Please see CONTRIBUTE.md for info on contributing.
Check out the demo for more style and feature examples.