dist/js/materialize.js
function Carousel(el, options) {
      _classCallCheck(this, Carousel);

      var _this62 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));

      _this62.el.M_Carousel = _this62;

      /**
       * Options for the carousel
       * @member Carousel#options
       * @prop {Number} duration
       * @prop {Number} dist
       * @prop {Number} shift
       * @prop {Number} padding
       * @prop {Number} numVisible
       * @prop {Boolean} fullWidth
       * @prop {Boolean} indicators
       * @prop {Boolean} noWrap
       * @prop {Function} onCycleTo
       */
      _this62.options = $.extend({}, Carousel.defaults, options);

      // Setup
      _this62.hasMultipleSlides = _this62.$el.find('.carousel-item').length > 1;
      _this62.showIndicators = _this62.options.indicators && _this62.hasMultipleSlides;
      _this62.noWrap = _this62.options.noWrap || !_this62.hasMultipleSlides;
      _this62.pressed = false;
      _this62.dragged = false;
      _this62.offset = _this62.target = 0;
      _this62.images = [];
      _this62.itemWidth = _this62.$el.find('.carousel-item').first().innerWidth();
      _this62.itemHeight = _this62.$el.find('.carousel-item').first().innerHeight();
      _this62.dim = _this62.itemWidth * 2 + _this62.options.padding || 1; // Make sure dim is non zero for divisions.
      _this62._autoScrollBound = _this62._autoScroll.bind(_this62);
      _this62._trackBound = _this62._track.bind(_this62);

      // Full Width carousel setup
      if (_this62.options.fullWidth) {
        _this62.options.dist = 0;
        _this62._setCarouselHeight();

        // Offset fixed items when indicators.
        if (_this62.showIndicators) {
          _this62.$el.find('.carousel-fixed-item').addClass('with-indicators');
        }
      }

      // Iterate through slides
      _this62.$indicators = $('<ul class="indicators"></ul>');
      _this62.$el.find('.carousel-item').each(function (el, i) {
        _this62.images.push(el);
        if (_this62.showIndicators) {
          var $indicator = $('<li class="indicator-item"></li>');

          // Add active to first by default.
          if (i === 0) {
            $indicator[0].classList.add('active');
          }

          _this62.$indicators.append($indicator);
        }
      });
      if (_this62.showIndicators) {
        _this62.$el.append(_this62.$indicators);
      }
      _this62.count = _this62.images.length;

      // Cap numVisible at count
      _this62.options.numVisible = Math.min(_this62.count, _this62.options.numVisible);

      // Setup cross browser string
      _this62.xform = 'transform';
      ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
        var e = prefix + 'Transform';
        if (typeof document.body.style[e] !== 'undefined') {
          _this62.xform = e;
          return false;
        }
        return true;
      });

      _this62._setupEventHandlers();
      _this62._scroll(_this62.offset);
      return _this62;
    }
function Carousel(el, options) {
      _classCallCheck(this, Carousel);

      var _this62 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));

      _this62.el.M_Carousel = _this62;

      /**
       * Options for the carousel
       * @member Carousel#options
       * @prop {Number} duration
       * @prop {Number} dist
       * @prop {Number} shift
       * @prop {Number} padding
       * @prop {Number} numVisible
       * @prop {Boolean} fullWidth
       * @prop {Boolean} indicators
       * @prop {Boolean} noWrap
       * @prop {Function} onCycleTo
       */
      _this62.options = $.extend({}, Carousel.defaults, options);

      // Setup
      _this62.hasMultipleSlides = _this62.$el.find('.carousel-item').length > 1;
      _this62.showIndicators = _this62.options.indicators && _this62.hasMultipleSlides;
      _this62.noWrap = _this62.options.noWrap || !_this62.hasMultipleSlides;
      _this62.pressed = false;
      _this62.dragged = false;
      _this62.offset = _this62.target = 0;
      _this62.images = [];
      _this62.itemWidth = _this62.$el.find('.carousel-item').first().innerWidth();
      _this62.itemHeight = _this62.$el.find('.carousel-item').first().innerHeight();
      _this62.dim = _this62.itemWidth * 2 + _this62.options.padding || 1; // Make sure dim is non zero for divisions.
      _this62._autoScrollBound = _this62._autoScroll.bind(_this62);
      _this62._trackBound = _this62._track.bind(_this62);

      // Full Width carousel setup
      if (_this62.options.fullWidth) {
        _this62.options.dist = 0;
        _this62._setCarouselHeight();

        // Offset fixed items when indicators.
        if (_this62.showIndicators) {
          _this62.$el.find('.carousel-fixed-item').addClass('with-indicators');
        }
      }

      // Iterate through slides
      _this62.$indicators = $('<ul class="indicators"></ul>');
      _this62.$el.find('.carousel-item').each(function (el, i) {
        _this62.images.push(el);
        if (_this62.showIndicators) {
          var $indicator = $('<li class="indicator-item"></li>');

          // Add active to first by default.
          if (i === 0) {
            $indicator[0].classList.add('active');
          }

          _this62.$indicators.append($indicator);
        }
      });
      if (_this62.showIndicators) {
        _this62.$el.append(_this62.$indicators);
      }
      _this62.count = _this62.images.length;

      // Cap numVisible at count
      _this62.options.numVisible = Math.min(_this62.count, _this62.options.numVisible);

      // Setup cross browser string
      _this62.xform = 'transform';
      ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
        var e = prefix + 'Transform';
        if (typeof document.body.style[e] !== 'undefined') {
          _this62.xform = e;
          return false;
        }
        return true;
      });

      _this62._setupEventHandlers();
      _this62._scroll(_this62.offset);
      return _this62;
    }
function Carousel ( el , options ) { _classCallCheck ( this , Carousel ) ; var _this62 = _possibleConstructorReturn ( this , ( Carousel . __proto__ || Object . getPrototypeOf ( Carousel ) ) . call ( this , Carousel , el , options ) ) ; _this62 . el . M_Carousel = _this62 ; /**
       * Options for the carousel
       * @member Carousel#options
       * @prop {Number} duration
       * @prop {Number} dist
       * @prop {Number} shift
       * @prop {Number} padding
       * @prop {Number} numVisible
       * @prop {Boolean} fullWidth
       * @prop {Boolean} indicators
       * @prop {Boolean} noWrap
       * @prop {Function} onCycleTo
       */ _this62 . options = $ . extend ( { } , Carousel . defaults , options ) ; // Setup _this62 . hasMultipleSlides = _this62 . $el . find ( '.carousel-item' ) . length > 1 ; _this62 . showIndicators = _this62 . options . indicators && _this62 . hasMultipleSlides ; _this62 . noWrap = _this62 . options . noWrap || ! _this62 . hasMultipleSlides ; _this62 . pressed = false ; _this62 . dragged = false ; _this62 . offset = _this62 . target = 0 ; _this62 . images = [ ] ; _this62 . itemWidth = _this62 . $el . find ( '.carousel-item' ) . first ( ) . innerWidth ( ) ; _this62 . itemHeight = _this62 . $el . find ( '.carousel-item' ) . first ( ) . innerHeight ( ) ; _this62 . dim = _this62 . itemWidth * 2 + _this62 . options . padding || 1 ; // Make sure dim is non zero for divisions. _this62 . _autoScrollBound = _this62 . _autoScroll . bind ( _this62 ) ; _this62 . _trackBound = _this62 . _track . bind ( _this62 ) ; // Full Width carousel setup if ( _this62 . options . fullWidth ) { _this62 . options . dist = 0 ; _this62 . _setCarouselHeight ( ) ; // Offset fixed items when indicators. if ( _this62 . showIndicators ) { _this62 . $el . find ( '.carousel-fixed-item' ) . addClass ( 'with-indicators' ) ; } } // Iterate through slides _this62 . $indicators = $ ( '<ul class="indicators"></ul>' ) ; _this62 . $el . find ( '.carousel-item' ) . each ( function ( el , i ) { _this62 . images . push ( el ) ; if ( _this62 . showIndicators ) { var $indicator = $ ( '<li class="indicator-item"></li>' ) ; // Add active to first by default. if ( i === 0 ) { $indicator [ 0 ] . classList . add ( 'active' ) ; } _this62 . $indicators . append ( $indicator ) ; } } ) ; if ( _this62 . showIndicators ) { _this62 . $el . append ( _this62 . $indicators ) ; } _this62 . count = _this62 . images . length ; // Cap numVisible at count _this62 . options . numVisible = Math . min ( _this62 . count , _this62 . options . numVisible ) ; // Setup cross browser string _this62 . xform = 'transform' ; [ 'webkit' , 'Moz' , 'O' , 'ms' ] . every ( function ( prefix ) { var e = prefix + 'Transform' ; if ( typeof document . body . style [ e ] !== 'undefined' ) { _this62 . xform = e ; return false ; } return true ; } ) ; _this62 . _setupEventHandlers ( ) ; _this62 . _scroll ( _this62 . offset ) ; return _this62 ; }
Construct Carousel instance
@constructor
@param {Element} el
@param {Object} options
Construct Carousel instance