Jump to content
Search Community

Animations aren'ts working

alostdeveloper 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

Hey alostdeveloper and welcome to the forums.

 

This is likely due to a loading issue of your assets but without seeing a live page it's very hard for us to help you figure out what's going wrong. Have you tried looking at your browser's console? Usually it will tell you if something is not loading or if you have a different error with your code.

  • Like 2
Link to comment
Share on other sites

As pointed out by PointC, the issue is that the script is trying to run before the DOM content that it's looking for is loaded.

 

If you need to keep the script in the head and can't move it to the bottom of the body, you should use the following instead:

 

document.addEventListener("DOMContentLoaded", function(event) { 
  // Your timeline code
});

 

  • Like 3
Link to comment
Share on other sites

3 hours ago, alostdeveloper said:

Any ideas why the animation would be working in IE and Safari, but not Chrome?

It was working in Chrome when I moved the script on the live page that you had shared previously. So no, no ideas why that may be the case. Maybe you can share a live version of the page again so we can look?

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