darkwing / ScrollSpy

ScrollSpy is a small but powerful MooTools plugin that allows you to listen to scrolling within any DOM element and execute functions based upon the element's scroll position.

This URL has Read+Write access

name age message
directory Docs/ Wed Sep 02 14:52:10 -0700 2009 Added links to docs [darkwing]
file README.md Wed Sep 02 14:52:10 -0700 2009 Added links to docs [darkwing]
directory Source/ Sun Nov 29 09:28:24 -0800 2009 Adding YAML headers for Forge [darkwing]
file package.yml Sun Nov 29 09:33:51 -0800 2009 Updating to current version [darkwing]
README.md

ScrollSpy

ScrollSpy is a small but powerful MooTools plugin that allows you to listen to scrolling within any DOM element and execute functions based upon the element's scroll position.

Screenshot

How to Use

ScrollSpy can be initialized at any time but is generally initialized at the top of the document during the page's normal load. There are no required arguments -- only options.

#JS
/* scrollspy instance */
var ss = new ScrollSpy({
    min: 300,
    onEnter: function() {
        $('gototop').fade('in'); //show the "Go To Top" link
    },
    onLeave: function() {
        $('gototop').fade('out'); //hide the "Go To Top" link
    },
    container: window
});

For specific usage and options, please read the documentation or visit http://davidwalsh.name/js/scrollspy