jannisg / jquery-equals

A simple jQuery plugin that allows you to equalize the height, width or both of a given stack of elements.

Home Page:http://jannisg.github.com/jquery-equals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jQuery Equals™ Plugin

A simple plugin to help maintain order amongst multiple elements that should really be the same size.

Usage:

Equalize the height only (default)

$('.element').equals();

Equalize the width only

$('.element').equals('width');

Equalize the height & width

$('.element').equals('both');

Center the content (beta)

$('.element').equals('both', true); // will equalize height and width and will center the content

Note: Only supports single elements within the equalized container for now, buggy in all but Gecko browsers.

For example, this will work:

<div class="element">
    <a href="#">
        <img src="sample-image.jpg" alt="Just proving my point." />
    </a>
</div>

This currently will not:

<div class="element">
    <h1>Headline</h1>
    <p>Text.</p>
</div>

Bonus

This plugin is chainable.

The following will work.

$('.element').hide().equals().delay(400).slideDown(800)

About

A simple jQuery plugin that allows you to equalize the height, width or both of a given stack of elements.

http://jannisg.github.com/jquery-equals/


Languages

Language:JavaScript 100.0%