_demo/assets/js/list-scroll.js
function add( element, options ) {
    // Only allow ul/ol
    if( !element.nodeName || /^(ul|li)$/i.test( element.nodeName ) === false ) {
      return false;
    }
    // Delete duplicates (but continue and re-bind this list to get the 
    // latest properties and list items)
    else if( contains( element ) ) {
      remove( element );
    }

    var list = IS_TOUCH_DEVICE ? new TouchList( element ) : new List( element );

    // Handle options
    if( options && options.live ) {
      list.syncInterval = setInterval( function() {
        list.sync.call( list );
      }, LIVE_INTERVAL );
    }

    // Synchronize the list with the DOM
    list.sync();

    // Add this element to the collection
    lists.push( list );

    // Start refreshing if this was the first list to be added
    if( lists.length === 1 ) {
      active = true;
      refresh();
    }
  }
function add( element, options ) {
    // Only allow ul/ol
    if( !element.nodeName || /^(ul|li)$/i.test( element.nodeName ) === false ) {
      return false;
    }
    // Delete duplicates (but continue and re-bind this list to get the 
    // latest properties and list items)
    else if( contains( element ) ) {
      remove( element );
    }

    var list = IS_TOUCH_DEVICE ? new TouchList( element ) : new List( element );

    // Handle options
    if( options && options.live ) {
      list.syncInterval = setInterval( function() {
        list.sync.call( list );
      }, LIVE_INTERVAL );
    }

    // Synchronize the list with the DOM
    list.sync();

    // Add this element to the collection
    lists.push( list );

    // Start refreshing if this was the first list to be added
    if( lists.length === 1 ) {
      active = true;
      refresh();
    }
  }
function add ( element , options ) { // Only allow ul/ol if ( ! element . nodeName || / ^(ul|li)$ / i . test ( element . nodeName ) === false ) { return false ; } // Delete duplicates (but continue and re-bind this list to get the  // latest properties and list items) else if ( contains ( element ) ) { remove ( element ) ; } var list = IS_TOUCH_DEVICE ? new TouchList ( element ) : new List ( element ) ; // Handle options if ( options && options . live ) { list . syncInterval = setInterval ( function ( ) { list . sync . call ( list ) ; } , LIVE_INTERVAL ) ; } // Synchronize the list with the DOM list . sync ( ) ; // Add this element to the collection lists . push ( list ) ; // Start refreshing if this was the first list to be added if ( lists . length === 1 ) { active = true ; refresh ( ) ; } }
Starts monitoring a list and applies classes to each of
its contained elements based on its position relative to
the list's viewport.

@param {HTMLElement} element
@param {Object} options Additional arguments;
- live; Flags if the DOM should be repeatedly checked for changes
repeatedly. Useful if the list contents is changing. Use
scarcely as it has an impact on performance.
Starts monitoring a list and applies classes to each of its contained elements based on its position relative to the list s viewport .