Add the plugin to your website.
<script src="/path/to/imageScale.js" type="text/javascript" />
Call the .imageScale();
method on any image tag (<img>
), and the plugin will automatically fill the image to the parent container, centering horizontally and/or vertically if necessary.
Call the .imageScale([parent selector]);
method, and the image will fill the box of the specified parent selector.
This plugin depends on the use of margin-top
, margin-left
, height
, and width
css attributes. Heighth, width, and margins are set in percent so they are completely scalable. Yay!
Questions, comments, and concerns, either here on GitHub or to [email protected]