jQuery Scroll To Fixed Plugin
A plugin that tracks an element (or elements) as it scrolls up the page, and when it reaches the top (or configurable number of pixels from the top) it will switch itself to a fixed position. Created when we wanted a sidebar navigation to stay on-screen on a tall page.
- jquery.scrollToFixed.js (3.3k)
- jquery.scrollToFixed.min.js (0.7k)
- This plugin is released under the MIT License
View the plugin demo page for a basic example.
Optional padding example page to show additional padding parameter to stop the sidebar from scrolling a set nubmer of pixels from the top of the page.
Another test page showing handling of a sidebar that is taller than the viewport.
Like this? Want to help keep the free stuff flowing? Buy us a cup of coffee! We're not all fancy-pants, so it's under two bucks!