FitText.js
FitText.js copied to clipboard
Refactored
I just saw you on CSS Summit today. I love the small library philosophy for JavaScript. Anyway I wanted to send you my two cents on fittext just in case you were looking for any collaboration. If not, I at least got to understand your code a little more. Keep on rockin out with the small JS libs.
Does this mean defaults attaches global namespace? It should probably be under $.fn.fitText in order to be polite. Right?
No, defaults isn't in the global scope. It is in the function/closure scope where the plugin is the only code that can access it. This way that value isn't re-evaluated each time the plugin is executed only once per page load.