Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery plugin to fit text into a width/height defined element

I know about fitText.js and bigText.js, but neither are meant for a multiple line headline (bigText can do multiple lines, but you have to wrap each line in a div, which won't work here). Put simply, give an <h1> with width: 200px; height: 175px; is there a jQuery plugin that will dynamically resize the text until it's all visible?

Something like this: <h1>My Short Headline</h1> would be large, but something like <h1>My Somewhat Longer Headline That Needs To Be Completely Visible With No Truncation</h1> would be quite a bit smaller. Know of anything that would do the trick?

like image 576
bjork24 Avatar asked Oct 19 '11 19:10

bjork24


1 Answers

Came up with my own solution: http://jsfiddle.net/bjork24/VQEC9/

Now I just need to throw it into a plugin and I'll be good to go.

like image 142
bjork24 Avatar answered Oct 13 '22 11:10

bjork24