Closed opanitch closed 9 years ago
my instantiation call uses classes - $("h2.projTitle").fitText(1.2);
So I apply the same fitText rules to all h2 elements with class projTitle rather than just 1
ah, i see why you asked - it does seem like a silly update, but the function did not work on my elements in the original implementation. Not really sure what makes these changes special, but it works. See http://staging.anatomidesign.com/jbd/#portfolio for an example
Can you supply a reduced test case of FitText not working on multiple elements using a class selector? It should totally do that already.
On Sat, Nov 15, 2014 at 11:00 AM, Oren notifications@github.com wrote:
my instantiation call uses classes - $("h2.projTitle").fitText(1.2);
So I apply the same fitText rules to all h2 elements with class projTitle rather than just 1
Reply to this email directly or view it on GitHub: https://github.com/davatron5000/FitText.js/pull/124#issuecomment-63179289
I figured out what it was - I had to alter the the parent that the script pulled the width from because the object it was sitting in was initially a constricted width that would then animate open. It didn't resize after the animation. You can delete this pull request, but possibly open an issue about css animations/on object resize?
If an element doesn't have width we can't calculate the fluid width. You'd have to $(window).trigger('resize.fittext')
when you animate the parent div
open.
Glad to hear it's working for you!
On Sat, Nov 15, 2014 at 12:50 PM, Oren notifications@github.com wrote:
I figured out what it was - I had to alter the the parent that the script pulled the width from because the object it was sitting in was initially a constricted width that would then animate open. It didn't resize after the animation. You can delete this pull request, but possibly open an issue about css animations/on object resize?
Reply to this email directly or view it on GitHub: https://github.com/davatron5000/FitText.js/pull/124#issuecomment-63183407
ah good tip, thanks!
Updated the code to allow the use of class names (and thus, multiple items) to have fitText applied at once