Socket
Book a DemoInstallSign in
Socket

jquery.stretch

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery.stretch

To fill the void created by the missing 'width: stretch' css property.

latest
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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.

Keywords

jquery

FAQs

Package last updated on 15 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts