Sha256: 0bdc5e990549c8ca8079d7b56ca37afa374186cc9055d28318e9c9437f79d02e

Contents?: true

Size: 1.24 KB

Versions: 101

Compression:

Stored size: 1.24 KB

Contents

/**
 * equalize.js
 * Author & copyright (c) 2012: Tim Svensen
 * Dual MIT & GPL license
 *
 * Page: http://tsvensen.github.com/equalize.js
 * Repo: https://github.com/tsvensen/equalize.js/
 *
 * The jQuery plugin for equalizing the height or width of elements.
 *
 * Equalize will accept any of the jQuery Dimension methods:
 *   height, outerHeight, innerHeight,
 *   width, outerWidth, innerWidth.
 *
 * EXAMPLE
 * $('.parent').equalize(); // defaults to 'height'
 * $('.parent').equalize('width'); // equalize the widths
 */
(function($, window, document, undefined) {

  $.fn.equalize = function(equalize) {
    var $containers = this, // this is the jQuery object
        equalize    = equalize || 'height',
        type        = (equalize.indexOf('eight') > 0) ? 'height' : 'width';

    if (!$.isFunction($.fn[equalize])) { return false; }

    return $containers.each(function() {
      var $children = $(this).children(),
          max = 0; // reset for each container

      $children.each(function() {
        var value = $(this)[equalize]();  // call height(), outerHeight(), etc.
        if (value > max) { max = value; } // update max
      });

      $children.css(type, max +'px'); // add CSS to children
    });
  };

}(jQuery, window, document));

Version data entries

101 entries across 101 versions & 4 rubygems

Version Path
solidus_backend-1.1.4 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.7 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.6 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.3 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.5 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.4 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.2 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.3 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.1 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.0 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.0.pre2 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.0.pre1 vendor/assets/javascripts/equalize.js
solidus_backend-1.1.0.beta1 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.2 vendor/assets/javascripts/equalize.js
spree_backend-2.4.10 vendor/assets/javascripts/equalize.js
spree_backend-2.3.13 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.1 vendor/assets/javascripts/equalize.js
spree_backend-2.2.14 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.0 vendor/assets/javascripts/equalize.js
solidus_backend-1.0.0.rc2 vendor/assets/javascripts/equalize.js