Share Posted January 30, 2018 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 More sharing options...
Share Posted January 30, 2018 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) Link to comment Share on other sites More sharing options...
Author Share Posted January 30, 2018 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 More sharing options...
Author Share Posted January 30, 2018 I've turned off all scripts except js/SplitText.min.js https://...../libs/gsap/1.20.3/TweenLite.min.js https://..../libs/gsap/1.20.3/TimelineLite.min.js and my working script but have commented out everything except the splitText function I posted. The problem can only be either the local environment, the splitText function or the html! Buzz Link to comment Share on other sites More sharing options...
Author Share Posted January 30, 2018 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 1 Link to comment Share on other sites More sharing options...
Share Posted January 30, 2018 Well, glad it was something simple. Don't worry, we've all been in similar situations. Its part of the developer's life. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now