Jump to content
Search Community

SplitText Function Call not working locally...

cfx test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Guys, I don't understand this, using this simple splitText action inside a function, works fine on codepen but locally getting in browser console:

 

TypeError: undefined is not an object (evaluating 'a.length')

 

Any ideas? Set up is code in a local .js file correctly linked and working with other animations and html elements in index.html exactly as codepen example.

 

2 a.m. here so that might have something to do with it, not normally this dense...

 

Buzz

See the Pen mXdvQr by cfx (@cfx) on CodePen

Link to comment
Share on other sites

7 hours ago, Carl said:

not really sure. are you running the same version of SplitText?

The CodePen one uses 0.5.8

 

Add this locally to test 


console.log(SplitText.version)

 

 

Just done that Carl, reports 0.5.8..

Link to comment
Share on other sites

Ok, clearly never do things at 2 a.m. - turns out my index.js was ref'd in the head so of course it wasn't picking up the string elements on the page before the script ran.

 

doh.

 

Hope this maybe helpful to other late night developers. Now where's my coffee..

 

Thanks Carl.

 

Buzz

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...