Bootstrap scroll to top button Inspired By Pinterest.
A scroll to top Button for Twitter Bootstrap . Inspired By Pinterest.
1-Html :
<button class="btn btn-danger Bootscroll" href = "#top" type="button"><i class="icon-arrow-up icon-white"></i>Scroll To top</button>
2-Javascript :
$(document).ready(function () {
$.scrollUp();
});
$(function () {
$.scrollUp({
topDistance: 70, // Distance from top before showing element (px)
topSpeed: 1000, // Speed back to top (ms)
animation: 'slide', // Fade, slide, none
animationInSpeed: 600, // Animation in speed (animation of the button) (ms)
animationOutSpeed: 600 // Animation out speed (animation of the button) (ms)
});
});
To Modify the Button placement , you can refer to the Bootscroll class ; css style can be found in style.css . The default style is :
.Bootscroll {
bottom: -5px;
right: 20px;
height : 80px;
width : 70px;
}
Bootscroll is licenced under the MIT Licence .
Any contribution from Anyone is very welcome.
Author : Mohamed Mbarki . Twitter : http://twitter.com/mbarki2009 . Git : @mbarki-mohamed .