Jump to content
Search Community

MorphSVG test works in Codepen but not on my site

Trev test
Moderator Tag

Go to solution Solved by Trev,

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

Hi one and all - I have a small test that has produced nothing on my site but I just loaded it to Codepen (from "Morphing Countdown" by Chris Gannon) and I get nearly what I was after

Is there something else I need to load apart from MorphSVG & TweenMax? Perhaps I should load these some other way?

Internet Explorer is showing "Cannot load a null target" TweenMax.min.js (16,27469).

I have it loaded on my site at: www.ezpc.eu/anitalouise.html

Thanks to anyone who has time to look at this - Trev 

See the Pen GpxgpB?editors=100 by thorntontf (@thorntontf) on CodePen

Link to comment
Share on other sites

Trev, could you show us the page that has the scripts loaded at the bottom and is still giving the error? It looks to me like ohem is right - you've got a script running that is referencing an element that is LOWER on the page, thus it hasn't been parsed by the browser yet and doesn't exist (hence the null target error). 


In other words, the browser reads from the top down, so if it hits your script that is saying "tween #a1" but that #a1 element is lower on the page, the browser chokes and is like "wait...I don't see any #a1 in memory yet, so I'll barf out an error". Moving your script to the bottom (or tuck it into an onload event) will ensure that the elements are parsed and available to the browser.

  • Like 1
Link to comment
Share on other sites

  • Solution

Apologies to ohem and thanks to you both - I threw ALL my JS including anitalouise.js down there and BANG - all good!

I even threw in a little window.onload to play my timeline as suggested 

Thanks to you both and thanks for the Banners broadcast the other night - very informative

  • Like 2
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...