Skip to content
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.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Docs
Source Optimized, added remover as well. Oct 16, 2010
README.md
package.yml

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
/* my "Go To Top" link element */
var link = document.id('gototop');
/* scrollspy instance */
var ss = new ScrollSpy({
    min: 300,
    onEnter: function() {
        link.fade('in'); //show the "Go To Top" link
    },
    onLeave: function() {
        link.fade('out'); //hide the "Go To Top" link
    }
});

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

Something went wrong with that request. Please try again.