Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Maximum font size added to prevent layout breaking with extremely sho…

…rt slabs (e.g. 1-char words)
  • Loading branch information...
commit e67c8593c4ab31009922ca6b8acecf7252fd8c50 1 parent d0c4c05
@cmex cmex authored
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" : 80
};
// 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();
Please sign in to comment.
Something went wrong with that request. Please try again.