Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$(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
You can’t perform that action at this time.