forked from viveleroi/jquery.expandtext
-
Notifications
You must be signed in to change notification settings - Fork 0
Increases/descreses font size with the parent container
iulianghel/jquery.expandtext
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
jQuery ExpandText By Michael Botsko 2011 Introduction ============================ This plugin increases or decreases text size depending on the width and height of it's container. It works by wrapping the text in a span and measuring gradual font changes until the width/height hits the parent limits. Since we're not calculating string width it will work properly no matter what fonts are used. In this example, we run the calculation every time the window is resized but that can have a performance hit especially when there is a large difference between your minimum and maximum font sizes. Using ============================ Find an element and run: $('div').expandText(); You can also pass in the minimum/maximum font sizes so things don't get out of control: $('div').expandText({ min: 20, max: 80 }); If you want this attached to the window/document resize but need to throttle it, check out the jQuery Resize plugin which works perfectly: http://benalman.com/projects/jquery-resize-plugin/
About
Increases/descreses font size with the parent container
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published