davatron5000 / FitText.js

A jQuery plugin for inflating web type
http://fittextjs.com
6.76k stars 1.39k forks source link

Added resizeModifier for selectively adding or removing specific fitText() calls #107

Open Sawtaytoes opened 10 years ago

Sawtaytoes commented 10 years ago

Helps with responsive designs where at certain breakpoints the resize operation should no longer take place regardless of a minimum or maximum font-size.

davatron5000 commented 10 years ago

Thanks @Saturn2888 for the commit. This seems really specific to your current implementation and JS breakpoint management dependencies. Would you mind giving some background?

Sawtaytoes commented 10 years ago

I'm having trouble remembering exactly why this was important so my description here may be lacking.

I remember needing to control FitText.js on particular items independently so it was able to be enabled and disabled using jQuery.off() and $.fitText().

I think I did this to add a method of changing the font-size based on the breakpoint rather than a min or max value; although, I remember there was something else I was hitting up against on a few projects which is why I eventually came to this solution.

It allowed me to disable and enable FitText.js selectively rather than globally. When using it on a bunch of different items, This was very useful. Another benefit I can see is there's no need to constantly eyeball the min or max font sizes.