diff --git a/README.md b/README.md index 7c1e46c..cb08849 100644 --- a/README.md +++ b/README.md @@ -28,22 +28,26 @@ This will hopefully give you a level of "control" that might not be pixel perfec FitText now allows you to specify two optional pixel values: `minFontSize` and `maxFontSize`. Great for situations when you want to preserve hierarchy. ```javascript -jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: '40px' }) +jQuery("#responsive_headline").fitText(1.2, { minFontSize: '20px', maxFontSize: '40px' }); ``` ## CSS FAQ -- **Make sure your container has a width!** +- :warning: Run FitText before anything that hides the element you're trying to size (e.g. before Carousels, Scrollers, Accordions, Tabs, etc). Hiding an element's container removes its width. It can't resize without a width. +- :warning: **Make sure your container has a width!** - `display: inline` elements don't have a width. Use `display: block` OR `display: inline-block`+ a specified width (i.e. `width: 100%`). - `position:absolute` elements need a specified width as well. - Tweak until you like it. - Set a No-JS fallback font-size in your CSS. +- :new: If your text is full width, you might want to **NOT** use FitText and just use CSS `vw` units instead. Supported in all major browsers. ## Don't use jQuery? That's okay. Check out these handy non-jQuery versions maintained by other people. - [non-jQuery FitText](https://github.com/adactio/FitText.js) from @adactio - [Angular.js FitText.js](https://github.com/patrickmarabeas/AngularJS-FitText.js) from @patrickmarabeas +- [AMP-HTML FitText](https://github.com/ampproject/amphtml/tree/master/extensions/amp-fit-text) +- [FitText UMD](https://github.com/peacechen/FitText-UMD) by @peacechen ## Changelog * `v 1.2` - Added `onorientationchange` event diff --git a/bower.json b/bower.json index 44dfb61..c4887a3 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { - "name": "FitText.js", + "name": "jquery-fittext", "version": "1.2.0", - "main": "./jquery.fittext.js", + "main": "jquery.fittext.js", "dependencies": { "jquery": ">= 1.6" },