OVERVIEW
Scroll Follow is a simple jQuery plugin that enables a DOM object to follow the page as the user scrolls. Scroll Follow has been successfully tested on IE6, IE7, FF2, FF3, Safari 3, and Opera 9 on Windows. It has been successfully tested on FF3 and Safari 3 on MacOSX.
REQUIREMENTS
- jQuery (tested with 1.2.6)
- jQuery UI Core (tested with 1.5.2)
OPTIONAL
INSTALLATION
- Include jQuery:
- <script type=”text/javascript” src=”jquery.js”></script>
- Include required plugins, including Scroll Follow:
- <script type=”text/javascript” src=”ui.core.js”></script>
- <script type=”text/javascript” src=”jquery.scrollFollow.js”></script>
- Call Scroll Follow on the desired DOM object:
View Example- <script type=”text/javascript”>
- $( ‘#example’ ).scrollFollow();
- </script>
- Or call Scroll Follow on the desired DOM object and give it some parameters:
View Example- <script type=”text/javascript”>
- $( document ).ready( function () {
- $( ‘#example’ ).scrollFollow( {
- speed: 1000,
- offset: 60,
- killSwitch: ‘exampleLink’,
- onText: ‘Disable Follow’,
- offText: ‘Enable Follow’
- } );
- } );
- </script>
- The Scroll Follow object will remain inside its immediate container.
View Example - Or you can specify a parent (by ID) for the Scroll Follow object to consider its container:
View Example- <script type=”text/javascript”>
- $( document ).ready( function () {
- $( ‘#example’ ).scrollFollow( {
- container: ‘outer’
- } );
- } );
- </script>
- Scroll Follow uses the “top” property of an object to slide it. Therefore, the “position” of the object must be set to either “relative” or “absolute.” Other than that limitation, the Scroll Follow object should be completely configured through CSS.
- http://kitchen.net-perspective.com/open-source/scroll-follow/