A jQuery plugin for equal dimensions.
equalize.js
jQuery
core.js
mediaquery.js
By default, Equalize will set the height of an element's children to the largest of the group:
$(".target").equalize();
<div class="target">
<div>...</div>
<div>...</div>
<div>...</div>
</div>
Specify a valid target
selector to equalize specific child elements:
$(".target").equalize({
target: ".child"
});
<div class="target">
<div>
<p class="child">...</p>
</div>
<div>
<p class="child">...</p>
</div>
<div>
<p class="child">...</p>
</div>
</div>
Set the protperty
to width to Equalize the widths of elements, rather than heights:
$(".target").equalize({
property: "width"
});
Set instance options by passing a valid object at initialization, or to the public defaults
method. Custom options for a specific instance can also be set by attaching a data-equalize-options
attribute to the target elment. This attribute should contain the properly formatted JSON object representing the custom options.
Name | Type | Default | Description |
---|---|---|---|
maxWidth |
string |
'Infinity' |
Width at which to auto-disable plugin |
minWidth |
string |
'0' |
Width at which to auto-disable plugin |
property |
string |
"height" |
Property to size; 'height' or 'width' |
target |
string OR array |
null |
Target child selector(s); Defaults to direct descendants |
## Methods
Methods are publicly available to all active instances, unless otherwise stated.
Extends plugin default settings; effects instances created hereafter.
$.equalize("defaults", { ... });
Name | Type | Default | Description |
---|---|---|---|
options |
object |
{} |
New plugin defaults |
Removes plugin instance.
$(".target").equalize("destroy");
Disables instance of plugin
$(".target").equalize("disable");
Enables instance of plugin
$(".target").equalize("enable");
Resizes instance
$(".target").equalize("resize");
## CSS
Class | Type | Description |
---|---|---|
.fs-equalize-element |
element |
Target Element |