Skip to content

jQuery plugin that allows you to fit elements (like images) within their containers.

Notifications You must be signed in to change notification settings

mattfiocca/tailorfit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TailorFit

jQuery plugin that fits and centers elements within their containers.

Tested on all user-agents available on Chrome 26 dev tools:

  • IE 7+

  • FF 4+

  • iOS 3+ (iPad and iPhone)

  • Android

  • BlackBerry

  • MeeGo

  • Screenshots of tests done on browsershots.org:

Latest version will always be hosted at

http://dev.fhmp.net/tailorfit/tailorfit-latest.min.js

Usage

    $('#parent > img').load(function(){
        // maxWidth, maxHeight, maintain aspect ratio
        $(this).tailorfit({
                maxWidth  : this.width,
                maxHeight : this.height,
                ratio     : this.width / this.height
        });
    });

About

jQuery plugin that allows you to fit elements (like images) within their containers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published