js/components/stalker.js
function(element, options) {
        element = this.setElement(element);
        options = this.setOptions(options);

        if (!options.target || !options.marker) {
            throw new Error('A marker and target is required');
        }

        if (element.css('overflow') === 'auto') {
            this.container = element;
        }

        // Initialize events
        this.addEvents([
            ['scroll', 'container', $.throttle(this.onScroll.bind(this), options.throttle)],
            ['ready', 'document', 'onScroll']
        ]);

        this.initialize();

        // Gather markets and targets
        this.refresh();
    }
function(element, options) {
        element = this.setElement(element);
        options = this.setOptions(options);

        if (!options.target || !options.marker) {
            throw new Error('A marker and target is required');
        }

        if (element.css('overflow') === 'auto') {
            this.container = element;
        }

        // Initialize events
        this.addEvents([
            ['scroll', 'container', $.throttle(this.onScroll.bind(this), options.throttle)],
            ['ready', 'document', 'onScroll']
        ]);

        this.initialize();

        // Gather markets and targets
        this.refresh();
    }
function ( element , options ) { element = this . setElement ( element ) ; options = this . setOptions ( options ) ; if ( ! options . target || ! options . marker ) { throw new Error ( 'A marker and target is required' ) ; } if ( element . css ( 'overflow' ) === 'auto' ) { this . container = element ; } // Initialize events this . addEvents ( [ [ 'scroll' , 'container' , $ . throttle ( this . onScroll . bind ( this ) , options . throttle ) ] , [ 'ready' , 'document' , 'onScroll' ] ] ) ; this . initialize ( ) ; // Gather markets and targets this . refresh ( ) ; }
Initialize the stalker.

@param {jQuery} element
@param {Object} [options]
Initialize the stalker .