Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: undefined is not a function - Help #121

Closed
florian-oefner opened this issue Oct 15, 2014 · 5 comments
Closed

Uncaught TypeError: undefined is not a function - Help #121

florian-oefner opened this issue Oct 15, 2014 · 5 comments

Comments

@florian-oefner
Copy link

Hi,

Chrome is throwing Uncaught TypeError: undefined is not a function all the time.
I initialized just like described and used jquery v.2.1.1. I even tried the vanilla js plugin, but I got the same error.

I´m using it together with Foundation & Modernizer if that matters.

Here´s the code:

<script src="js/vendor/jquery.js"></script>
<script src="js/vendor/fittext.js"></script>
<script>
        $('#headline_main').fitText(1.2);
        $('#headline_second').fitText(1.2); 
</script>
@arthurvr
Copy link
Contributor

A testcase on jsfiddle would be nice, I can't reproduce this.

@dcondrey
Copy link

<script>
    jQuery('#headline_main').fitText(1.2);
    jQuery('#headline_second').fitText(1.2); 
</script>

Make sure jQuery is loaded

@florian-oefner
Copy link
Author

Hi,
thanks for your tips.
I´m sorry I totally forgot to include a jsfiddle.

Here is it now:
http://jsfiddle.net/9Lvte2nb/
And the fullscreen mode for better showcase of the problem:
http://jsfiddle.net/9Lvte2nb/embedded/result/

@dcondrey I tried what you suggested (as you can see in the fiddle), but didn´t help either.
JSFiddle isn´t throwing an Uncaught TypeError, but it still doesn´t work.
At least in Chrome on my machine.

Has anyone a clue whats going on?

Thanks a lot

@arthurvr
Copy link
Contributor

The issue is really easy. It's just a problem you did this in the css:

header h1 {
    font-size: 5.2rem !important;

Since it's tagged as !important, It doesn't get changed. Issue closed, I think?

Related issue: #88

@florian-oefner
Copy link
Author

Thanks for your help!
I don´t know why I have missed this mistake.

It works fine now.
The uncaught type error I mentioned occured because fittext.js wasn´t loaded when I called the function.

Thank you very much to all of you that helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants