jquery.stretch
v0.1.1
Published
To fill the void created by the missing 'width: stretch' css property.
Downloads
5
Readme
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 havedisplay: block
styling.- Works very well, most of the time.