Here is a very tiny jQuery plugin that I developed for making elements sticky. There are many others out there - some that do more - but none I could find that were 100% compatible with the default SharePoint master pages. If you have done any work with the scrollable areas within the default SharePoint HTML, you know what I am talking about. The way the ribbon and the 'workspace' areas work are a little funky. This plugin gives you the power of sticky within this context - and should also work fine for any situation where you want something to be sticky within a scrollable DIV element.
Usage:
- Include script in page.
- $("<selector>").floater();
Options:
- startOffset When the 'stickiness' should be invoked.
- offsetY When stuck, how close to the parent element should element be.
- stickyClass Css class added to element when stuck. Removed when un-stuck.
- onStart Event to invoke when sticky happens.
- onStop Event to invoke when un-sticky happens.