This time I will share jQuery Plugin and tutorial about Minimal Sticky Sidebar Using jQuery, hope it will help you in programming stack.
An ultra-small jQuery sticky sidebar plugin that can make the sidebar always visible when scrolling down the page.
How to use it:
1. Place the JavaScript stickySidebar.js
after loading the latest jQuery library.
1 |
< script src = "/path/to/cdn/jquery.min.js" ></ script > |
2 |
< script src = "/path/to/stickySidebar.js" ></ script > |
2. Attach the function stickySidebar to the sidebar element and the plugin will take care of the rest.
2 |
$( '#sidebar' ).stickySidebar(); |
3. Specify the distance between the sticky sidebar and the top of the page, usually slightly higher than the height of your sticky header. Default: 50.
2 |
$( '#sidebar' ).stickySidebar({ |
4. Specify the duration of the animation. Default: 300.
2 |
$( '#sidebar' ).stickySidebar({ |
5. Increase the footerThreshold
value to prevent the sticky element from pushing your footer element down. Default: 50.
2 |
$( '#sidebar' ).stickySidebar({ |