A jQuery Plugin for auto adjust the font-size to fill container
- using binary saerch
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.highfittext.js"></script>
<script>
jQuery('h1').highFitText();
</script>
The following parameter you can add
maxFontSize
maximal font size in pixel
minFontSize
minimal font size in pixel
sufficeAbsRange
tolerance in pixel of the width differs to the container width
maxWidth
the width that is optimal (default: parent container width)
If you want more exact fitting text: check out BigText by Zach Leatherman.