js/components/stalker.js
function() {
        var scroll = this.container.scrollTop(),
            offsets = this.offsets,
            onlyWithin = this.options.onlyWithin,
            threshold = this.options.threshold;

        this.markers.each(function(index, marker) {
            marker = $(marker);

            var offset = offsets[index],
                top = offset.top - threshold,
                bot = offset.top + marker.height() - threshold;

            // Scroll is within the marker
            if (
                (onlyWithin && scroll >= top && scroll <= bot) ||
                (!onlyWithin && scroll >= top)
            ) {
                this.activate(marker);

            // Scroll went outside the marker
            } else {
                this.deactivate(marker);
            }
        }.bind(this));

        this.fireEvent('scroll');
    }
function() {
        var scroll = this.container.scrollTop(),
            offsets = this.offsets,
            onlyWithin = this.options.onlyWithin,
            threshold = this.options.threshold;

        this.markers.each(function(index, marker) {
            marker = $(marker);

            var offset = offsets[index],
                top = offset.top - threshold,
                bot = offset.top + marker.height() - threshold;

            // Scroll is within the marker
            if (
                (onlyWithin && scroll >= top && scroll <= bot) ||
                (!onlyWithin && scroll >= top)
            ) {
                this.activate(marker);

            // Scroll went outside the marker
            } else {
                this.deactivate(marker);
            }
        }.bind(this));

        this.fireEvent('scroll');
    }
function ( ) { var scroll = this . container . scrollTop ( ) , offsets = this . offsets , onlyWithin = this . options . onlyWithin , threshold = this . options . threshold ; this . markers . each ( function ( index , marker ) { marker = $ ( marker ) ; var offset = offsets [ index ] , top = offset . top - threshold , bot = offset . top + marker . height ( ) - threshold ; // Scroll is within the marker if ( ( onlyWithin && scroll >= top && scroll <= bot ) || ( ! onlyWithin && scroll >= top ) ) { this . activate ( marker ) ; // Scroll went outside the marker } else { this . deactivate ( marker ) ; } } . bind ( this ) ) ; this . fireEvent ( 'scroll' ) ; }
While the element is being scrolled, notify the targets when a marker is reached.

@private
While the element is being scrolled notify the targets when a marker is reached .