Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 864 Bytes

File metadata and controls

25 lines (13 loc) · 864 Bytes

imageScale

A jQuery Plugin for scaling images to fit any box, without stretching the aspect ratio.

Usage

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.

Advanced

Call the .imageScale([parent selector]); method, and the image will fill the box of the specified parent selector.

Dependencies

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!

Contact

Questions, comments, and concerns, either here on GitHub or to brian@recruitedforcollege.com