A small jQuery-Plugin to make an element fit its parents width and maintaining ration.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.mdown
jquery.fillWidth.js

README.mdown

jQuery.fillWidth

Make an element fill its parents width and keep the aspect ratio.

Usage

HTML-Code:

<div class="some-container">
  <iframe width="420" height="315" src="http://www.youtube.com/embed/oHg5SJYRHA0" frameborder="0" allowfullscreen></iframe>
</div>

CSS-Code:

.some-container {
  width: 600px;
}

JS-Code:

$('.some-container iframe').fillWidth();

Configuration and Bugrepots

There are currently no configuration options. Feel free to open an issue if you have a feature request or run into any problem.