This time I will share jQuery Plugin and tutorial about Responsive Scroll Position Indicator Plugin With jQuery – scroll.js, hope it will help you in programming stack.
scroll.js is a really simple jQuery plugin that creates a progress bar to indicate the user’s current scroll position on your website. The plugin uses document.addEventListener()
method to detect / calculate the scroll position and will auto refresh the indicator bar on window resize. Dual licensed under the MIT or GPL Version 2 licenses.
How to use it:
1. Include jQuery library and the jQuery scroll.js script on your website.
1 |
< script src = "//code.jquery.com/jquery-1.12.4.min.js" ></ script > |
2 |
< script src = "jquery/scroll.js" ></ script > |
2. Create the html for the scroll position indicator.
1 |
< div class = "scrollbar" > |
2 |
< div class = "bar" ></ div > |
3. Style the indicator and stick it at the top or bottom of the webpage.
04 |
background-color : #F0F0F0 ; |
05 |
border-top : 1px solid #CCC ; |
14 |
background-color : #466068 ; |
This awesome jQuery plugin is developed by MitchRompelman. For more Advanced Usages, please check the demo page or visit the official website.