0.1.1 • Published 10 years ago

jquery.stretch v0.1.1

Weekly downloads
12
License
MIT
Repository
github
Last release
10 years ago

Man, if only this was native in css, but it isn't, so here is a jquery plugin for it.

Say we start with a parent div that contains three children. All three have display: inline-block style, so they are all lined up next to each other, with some extra space on the right.

npm.io

Now we do

$( '.rect3' ).stretch();

And we end up with

npm.io

Similarly, we could strech one of the other two inner divs so that they take up all the available space.

Couple notes:

  • Ignores hidden elements.
  • $.fn.stretchVertically is also installed, which works analogously to $.fn.stretch. When stretching vertically, all elements must have display: block styling.
  • Works very well, most of the time.
0.1.1

10 years ago

0.1.0

10 years ago