ScrollSpy 1.4

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.



Details

Author
David Walsh
Current version
1.4
GitHub
darkwing/ScrollSpy
Downloads
11747
Category
Utilities
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.2.1: *

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.

/* 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