This time I will share jQuery Plugin and tutorial about Scroll Page Back To Top With jQuery – toTop.js, hope it will help you in programming stack.
jQuery toTop.js is an ultra-light jQuery back to top plugin which enables an element to smooth scroll the page back to the top at a given speed.
How to use it:
1. Create a back to top button at the bottom of the page.
1 |
< div class = "totop" >↑ To Top</ div > |
2. Import jQuery library and the jQuery toTop.js script into the page.
1 |
< script src = "://code.jquery.com/jquery.min.js" ></ script > |
2 |
< script src = "totop.min.js" ></ script > |
3. Activate the back to top button.
4. Style the back to top button whatever you like.
5. Set the duration of the scroll animation.
6. Set the duration of the button show and hide animations.
2 |
scrtollTopBtnDuration: 400 |
7. Set the distance from the top of the page to reveal the back to top button.
This awesome jQuery plugin is developed by oasan. For more Advanced Usages, please check the demo page or visit the official website.