jquery.stretch

0.1.1 • Public • Published

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.

Now we do

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

And we end up with

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.

Readme

Keywords

Package Sidebar

Install

npm i jquery.stretch

Weekly Downloads

3

Version

0.1.1

License

MIT

Last publish

Collaborators

  • davidbeck