rj zaworskiA helping hand for giant headlines
InflateText remixes Dave Rupert's FitText.js by altering the resizer function to determine the maximum font-size that will allow an element to fit in the available horizontal space.
Invoke inflateText as any other jQuery plugin:
$('h1').inflateText();
You may optionally provide a scaling factor using the scale argument or set caps on the font size:
$('h1').inflateText({
maxFontSize: 96, //(px)
minFontSize: 32, //(px)
scale: 0.8
});
inflateText.js works in Chrome, Firefox, Opera, and IE8+, but please don't hesitate to fork+fix any issues you discover.
Unless a minimum font size is specified, InflateText will always attempt to fit the target text into a single line. Mix long headlines and mobile resolutions only at your own risk!
RJ Zaworski www.rjzaworski.com
inflateText.js is released under the JSON License. You can read the license here.