Hi Jonathan,
Thanks so much for the quick response.
So TweenMax and my scripts are definitely in the footer, in the right order.
This is how they look in my functions file:
wp_register_script( 'gsap-js', 'http://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js', array(), false, true );
wp_enqueue_script( 'gsap-js' );
wp_register_script( 'custom-script', get_stylesheet_directory_uri() . '/js/custom-script-b.js', array(), false, true );
wp_enqueue_script( 'custom-script' );
And the var was in my file, for some reason I didn't paste it in the pen. (I tried both methods with same results)
Here's what's happening:
The animation runs normally but as soon as it stops the "Uncaught TypeError: Cannot read property 'length' of undefined" error appears in the console with a running counter. If I use repeat:-1 no error appears.
This particular site is still in the local dev stage, but I can make a live dev site to test if needed.
Thanks so much for your help! I'll be golden if I could just get GSAP working with WordPress!
Janet