Jump to content
GreenSock

Learning

How to tween self?

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 guys,

 

Any idea how to set the this keyword to active on self?

E.g. below, when mouse over, self will rotate?

 

$( '#group1', '#group2', '#group3', '#group4', '#group5', '#group6' ).mouseover( function () {

    TweenMax.to( this, { rotation: 360, ease:Expo.easeOut, transformOrigin: '50% 50%'});

});

 

Thanks in advance!

Link to comment
Share on other sites

Hi Learning  :)

 

you just have issue in your jquery selector , pls try like this : 

$( '#group1 , #group2' ).mouseover( function () {
   TweenLite.to( this,1, { rotation:'+='+360});
});

See the Pen LGqaYz by MAW (@MAW) on CodePen

  • Like 3
Link to comment
Share on other sites

Very oddly it works when stripped down, but in my file, the 'this' just doesn't register... I wonder what could be the cause...

Oops, I just found out! It's because I'm adding extra '' to each item. =x Thanks!

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