Jump to content
Search Community

img rotate and vanish

cjebert 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

I am very new here and am working on an assignment for school.  It is basically just to animate something using Greensock.

 

Now I might have bit off more than I could chew but I was wondering, on the getting started video at about the 5 min point the caped guy "logo" rotates across the page and gets smaller.  What I would like to do is take my little Yokai watch guy roll from left to right and then vanish.  Do I need to be a member to do this? 

 

Also do I want to do this inline in the html file? Or create a separate js file?  I have tried downloading the GSAP files and pointing to them as well as using the online library.  

 
This little guy doesn't want to do anything. He is just there and doesn't move.
 
I have tried every way imaginable to no avail. I have reverted back to where I started.
 
HTML: index
<div id="rockabelly" style="transform: matrix(1, 0, 0, 1, 50, 0);"></div>

CSS: stylesheet:

#rockabelly{
   position: relative;
   width: 500px;
   height: 500px;
   background: url(http://yokaiwatchfans.com/mediawiki/images/5/5c/Rockabelly1.png)no-repeat;
}
js:
TweenMax.to(".rockabelly", 10, {x:50, rotation:360});
Link to comment
Share on other sites

 

I am very new here and am working on an assignment for school.  It is basically just to animate something using Greensock.

 

Now I might have bit off more than I could chew but I was wondering, on the getting started video at about the 5 min point the caped guy "logo" rotates across the page and gets smaller.  What I would like to do is take my little Yokai watch guy roll from left to right and then vanish.  Do I need to be a member to do this? 

 

Also do I want to do this inline in the html file? Or create a separate js file?  I have tried downloading the GSAP files and pointing to them as well as using the online library.  

 
This little guy doesn't want to do anything. He is just there and doesn't move.
 
I have tried every way imaginable to no avail. I have reverted back to where I started.
 
HTML: index

<div id="rockabelly" style="transform: matrix(1, 0, 0, 1, 50, 0);"></div>

 

CSS: stylesheet

#rockabelly{
position: relative;
width: 500px;
height: 500px;
}
js:
TweenMax.to(".rockabelly", 10, {x:50, rotation:360});

 

Change 

TweenMax.to(".rockabelly", 10, {x:50, rotation:360});

 to 

TweenMax.to("#rockabelly", 10, {x:50, rotation:360});

It should be a # not a . because you're tweening an ID not a class name.

 

See the Pen rePJyw by anon (@anon) on CodePen

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