_demo/assets/js/list-scroll.js
function batch( target, method, options ) {
    var i, len;

    // Selector
    if( typeof target === 'string' ) {
      var targets = document.querySelectorAll( target );

      for( i = 0, len = targets.length; i < len; i++ ) {
        method.call( null, targets[i], options );
      }
    }
    // Array (jQuery)
    else if( typeof target === 'object' && typeof target.length === 'number' ) {
      for( i = 0, len = target.length; i < len; i++ ) {
        method.call( null, target[i], options );
      }
    }
    // Single element
    else if( target.nodeName ) {
      method.call( null, target, options );
    }
    else {
      throw 'Stroll target was of unexpected type.';
    }
  }
function batch( target, method, options ) {
    var i, len;

    // Selector
    if( typeof target === 'string' ) {
      var targets = document.querySelectorAll( target );

      for( i = 0, len = targets.length; i < len; i++ ) {
        method.call( null, targets[i], options );
      }
    }
    // Array (jQuery)
    else if( typeof target === 'object' && typeof target.length === 'number' ) {
      for( i = 0, len = target.length; i < len; i++ ) {
        method.call( null, target[i], options );
      }
    }
    // Single element
    else if( target.nodeName ) {
      method.call( null, target, options );
    }
    else {
      throw 'Stroll target was of unexpected type.';
    }
  }
function batch ( target , method , options ) { var i , len ; // Selector if ( typeof target === 'string' ) { var targets = document . querySelectorAll ( target ) ; for ( i = 0 , len = targets . length ; i < len ; i ++ ) { method . call ( null , targets [ i ] , options ) ; } } // Array (jQuery) else if ( typeof target === 'object' && typeof target . length === 'number' ) { for ( i = 0 , len = target . length ; i < len ; i ++ ) { method . call ( null , target [ i ] , options ) ; } } // Single element else if ( target . nodeName ) { method . call ( null , target , options ) ; } else { throw 'Stroll target was of unexpected type.' ; } }
Calls 'method' for each DOM element discovered in
'target'.

@param target String selector / array of UL elements /
jQuery object / single UL element
@param method A function to call for each element target
Calls method for each DOM element discovered in target .