Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Josie Nagy14,992 Points
How should I use FitText.js? ( Web Typography -> Responsive Typography )
So I was watching 'Responsive Typography' when Mattox Schuler mentioned FitText (from this website: http://fittextjs.com/) as begin really useful when it comes to scaling display text.
Sounds great! But how do I actually use it?
I tried copy pasting this code into my CodePen project's html:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="jquery.fittext.js"></script> <script> jQuery("#responsive_headline").fitText(); </script>
... but nothing happened. I also downloaded their files from GitHub.
So what should I do now?
Boonsuen Oh18,788 Points
You wanted to use Fittext.js in CodePen. Notice that you are using a relative path instead of a CDN link or any link that points to the Fittext.js file.
Instead, use this one in CodePen.
In the environments where you can edit/modify the folder and files, like Treehouse Workspaces or your local computer, you can put the Fittext.js file anywhere you want, but remember to use a path that points correctly to the that file in the SRC attribute.