Skip to content
Browse files

Merge pull request #9 from cmex/master

Maximum font size
  • Loading branch information...
2 parents 8418a41 + f523f1d commit 109c79ee007ab8d5ca24c9194690e013055b49ba @freqdec committed Jun 6, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/jquery.slabtext.js
View
5 js/jquery.slabtext.js
@@ -16,7 +16,8 @@
"headerBreakpoint" : null,
"viewportBreakpoint" : null,
// Don't attach a resize event
- "noResizeEvent" : false
+ "noResizeEvent" : false,
+ "maxFontSize" : 9999
};
// Add the slabtexted classname to the body to initiate the styling of
@@ -150,7 +151,7 @@
fontSize = parseFloat(this.style.fontSize) || origFontSize;
// Resize font
- $span.css('font-size', (fontSize * ratio).toFixed(3) + "px");
+ $span.css('font-size', Math.min((fontSize * ratio).toFixed(3), settings.maxFontSize) + "px");
// Do we still have space to try to fill or crop
diff = parentWidth - $span.width();

0 comments on commit 109c79e

Please sign in to comment.
Something went wrong with that request. Please try again.