I have a div with fixed with and height and a big text. For example: http://jsfiddle.net/gEjTz/ I want to reseze text to appear in this div. How to do this? Thanks!
<div style="height: 20px; border: 1px solid black;">
<span style="display: inline-block; font-size: 50px;">This is my text that I want to fit ssssssssssssssssssssssssssssssss s</span>
</div>
$(function() {
var span = $('span');
var fontSize = parseInt(span.css('font-size'));
do {
fontSize--;
span.css('font-size', fontSize.toString() + 'px');
} while (span.height() >= 20);
});