Jump to content
Search Community

TweenMax.to() not working

freelancer13 test
Moderator Tag

Go to solution Solved by freelancer13,

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

um……i'm rookie trying to use TweenMax.min.js……

i download it form GIT and put it in my test project and pretty sure all files in the right directory,

html code here:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello TweenMax</title>

    <link rel="stylesheet" href="css/Xu.css">
</head>

<body>
    <script src="/js/jquery-2.1.4.min.js"></script>
    <div class="test-div"></div>


    <script src="/js/jquery.gsap.min.js"></script>
    <script src="/js/TweenMax.min.js"></script>
    <script src="/js/main.js"></script>
</body>

</html>

CSS code here

body
 {
     background-image: url("../Imgs/PageBg/bg.jpg");
 }

.test-div
{
    min-width: 50px;
    max-width: 50px;
    min-height: 50px;
    max-height: 50px;
    background-color: #79fe9c;
}

JS here

console.log("init");
TweenMax.to(".test-div",2,{left:600});

pretty simple code 

but 

it's not working……

don't know why

can any one tell me where i'm make misstake ?

THX for your time

Link to comment
Share on other sites

Hello freelancer13, and Welcome to the GreenSock Forum!

  • Are you using the latest GSAP TweenMax ,version 1.9.0? (at the time of this writing)

Something like this will be really hard to debug without testing your code live.

 

Here is a video tut on how to create a codepen example.



This way we can test your code live on codepen to better help you!

 

Also you dont need to include jquery.gsap.min.js unless your still going to use the jQuery animate() method, since jquery.gsap.min.js  is used to help jQuery animate() method use GSAP instead of its own internal.

 

Try the TweenMax cdn link 1.19.0

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js"></script>

Thanks! :)

Link to comment
Share on other sites

  • Solution

Hello freelancer13, and Welcome to the GreenSock Forum!

  • Are you using the latest GSAP TweenMax ,version 1.9.0? (at the time of this writing)

Something like this will be really hard to debug without testing your code live.

 

Here is a video tut on how to create a codepen example.

 

This way we can test your code live on codepen to better help you!

 

Also you dont need to include jquery.gsap.min.js unless your still going to use the jQuery animate() method, since jquery.gsap.min.js  is used to help jQuery animate() method use GSAP instead of its own internal.

 

Try the TweenMax cdn link 1.19.0

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js"></script>

Thanks! :)

 

 

(ง •̀_•́)ง OMG

sorry to trouble you 

and 

i know where i'm dead……

 

THX

and thank the GreenSock team for all your great working

 

next i'll use codepen

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