js/components/carousel.js
function() {
        if (this.options.animation === 'fade') {
            return;
        }

        var dimension = this._dimension, // height or width
            containerSize = 0,
            sizes = [];

        this.container.removeAttr('style');

        this.items.each(function() {
            var item = $(this).removeAttr('style'),
                size = item[dimension](),
                marginStart = parseInt(item.css('margin-' + (dimension === 'width' ? 'left' : 'top')), 10),
                marginEnd = parseInt(item.css('margin-' + (dimension === 'width' ? 'right' : 'bottom')), 10),
                totalSize = size + marginStart + marginEnd;

            containerSize += totalSize;

            sizes.push({
                size: size,
                totalSize: totalSize,
                marginStart: marginStart,
                marginEnd: marginEnd,
                clone: item.hasClass('is-cloned')
            });

            // Set the size of the item explicitly
            item.css(dimension, size);
        });

        // Store the sizes
        this._sizes = sizes;

        // Set the container width/height
        this.container.css(dimension, containerSize);
    }
function() {
        if (this.options.animation === 'fade') {
            return;
        }

        var dimension = this._dimension, // height or width
            containerSize = 0,
            sizes = [];

        this.container.removeAttr('style');

        this.items.each(function() {
            var item = $(this).removeAttr('style'),
                size = item[dimension](),
                marginStart = parseInt(item.css('margin-' + (dimension === 'width' ? 'left' : 'top')), 10),
                marginEnd = parseInt(item.css('margin-' + (dimension === 'width' ? 'right' : 'bottom')), 10),
                totalSize = size + marginStart + marginEnd;

            containerSize += totalSize;

            sizes.push({
                size: size,
                totalSize: totalSize,
                marginStart: marginStart,
                marginEnd: marginEnd,
                clone: item.hasClass('is-cloned')
            });

            // Set the size of the item explicitly
            item.css(dimension, size);
        });

        // Store the sizes
        this._sizes = sizes;

        // Set the container width/height
        this.container.css(dimension, containerSize);
    }
function ( ) { if ( this . options . animation === 'fade' ) { return ; } var dimension = this . _dimension , // height or width containerSize = 0 , sizes = [ ] ; this . container . removeAttr ( 'style' ) ; this . items . each ( function ( ) { var item = $ ( this ) . removeAttr ( 'style' ) , size = item [ dimension ] ( ) , marginStart = parseInt ( item . css ( 'margin-' + ( dimension === 'width' ? 'left' : 'top' ) ) , 10 ) , marginEnd = parseInt ( item . css ( 'margin-' + ( dimension === 'width' ? 'right' : 'bottom' ) ) , 10 ) , totalSize = size + marginStart + marginEnd ; containerSize += totalSize ; sizes . push ( { size : size , totalSize : totalSize , marginStart : marginStart , marginEnd : marginEnd , clone : item . hasClass ( 'is-cloned' ) } ) ; // Set the size of the item explicitly item . css ( dimension , size ) ; } ) ; // Store the sizes this . _sizes = sizes ; // Set the container width/height this . container . css ( dimension , containerSize ) ; }
Calculate the widths or heights for the items, the wrapper, and the cycle.
Calculate the widths or heights for the items the wrapper and the cycle .