Created
June 12, 2015 23:03
-
-
Save newswim/b41774382697c83ba35e 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 () { | |
resize_to_fit(); | |
}); | |
function resize_to_fit(){ | |
var fontsize = $('div#outer div').css('font-size'); | |
$('div#outer div').css('fontSize', parseFloat(fontsize) - 1); | |
if($('div#outer div').height() >= $('div#outer').height()){ | |
resize_to_fit(); | |
} | |
} | |
// CSS-Tricks | |
$(function(){ | |
var $quote = $("#floor-plan-title"); | |
var $numWords = $quote.html/*()*/.length; | |
if (($numWords >= 1) && ($numWords < 10)) { | |
$quote.css("font-size", "36px"); | |
} | |
else if (($numWords >= 10) && ($numWords < 20)) { | |
$quote.css("font-size", "32px"); | |
} | |
else if (($numWords >= 20) && ($numWords < 30)) { | |
$quote.css("font-size", "28px"); | |
} | |
else if (($numWords >= 30) && ($numWords < 40)) { | |
$quote.css("font-size", "24px"); | |
} | |
else { | |
$quote.css("font-size", "20px"); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment