Created
September 22, 2010 06:57
-
-
Save landlessness/591260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| if ($('.resize-font').length) { | |
| $(window).resize(resize); | |
| resize(); | |
| } | |
| }); | |
| function resize() { | |
| // sizeCoefficient lets me decide how big the fonts are. | |
| // 0.75 gives about 10 words per line, which is good design | |
| var sizeCoefficient = 0.75; | |
| var newFontSize = Math.floor(sizeCoefficient * (0.0394 * $('.resize-font').width() + 0.2489)) | |
| $('.resize-font').css('font-size', newFontSize) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment