Jump to content
Search Community

Problems with tweenmax. new user!!

bchen5803 test
Moderator Tag

Go to solution Solved by Dipscom,

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

I just started with tweenmax today. went to the tutorial here...https://greensock.com/get-started-js

Followed everything. included the cdn. got myself an image...... got myself the reference to my javascript file.

copied exactly word for word and i couldnt get the animation to work. honestly didnt want to ask i've already spent 5 hours trying to figure it out with no avail. Everything is in the same folder.... I've even tried to switch the class to id and use document.getelemntbyid to reference it as well but doesnt work. can anyone tell me how to fix it? i dont really want to give up on this..... Also im using google chrome if that helps

 

Heres the tutorial code

 

<body>
  <div class="*%$#">
      <img class="logo" src="download.jpg">
  </div>
 
  <!--CDN link for  TweenMax-->
  <script src="test.js">
 
  </script>
</body>
 
and my javascript file
 
 
TweenMax.to(".logo",2,{left:600});
 
 
 
 
Link to comment
Share on other sites

  • Solution

Hi bchen5803,

 

Welcome to the forums!

 

It is a shame you are having difficulties getting started with GSAP. Hopefully this initial struggle will not taint the potential it offers your.

 

It is always best to have your code somewhere we can see all aspects of it and that we can fork and change. CodePen and JsFiddle are pretty common sites that people create their reduced case demos.

 

In the video bellow, Carl explains how to easily create a CodePen:

 

The reason it's always best to post a link to an editable demo over to pasting code in the thread is that we can see the whole context. Otherwise, we are all shooting in the dark.

 

For example: There appears to be nothing wrong with your HTML or you JS but what about the CSS? I have no idea if your .logo class has a position property set to something other than the default value (preferably either relative or absolute) - And that, would prevent you from seeing any animation. 

 

See if setting your .logo's position to relative helps. Failing that, come back with a little reduced case showing what you want to achieve.

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