Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Guest zachledoux

scale object size using mouse over

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

How would I implement a slight object scale change on mouse over?

 

Thanks!

Zach

Link to post
Share on other sites

Or what if I want to have the object animate it's scale and opacity in a loop when the page loads?

 

Thanks!

Zach

Link to post
Share on other sites

To have an animation repeat you can use TweenMax and provide a repeat value

 

//give the element a starting opacity of 0
TweenLite.set(myObj, {css:{opacity:0}});
//tween to scale:2 and opacity:1
TweenMax.to(myObj, 1, {css{scale:2, opacity:1}, repeat:5, yoyo:true});

 

Please have a look here: http://www.greensock...tart-js/#repeat

 

Use the "view full demo source" feature to access a link to download multiple sample files which I think you will find very useful.

Link to post
Share on other sites

The repeat works great. Is using "-1" the best way to set repeat to infinite?

 

The sample file download pack is awesome too, definitely a good starting point.

 

Thanks again,

Zach

Link to post
Share on other sites
Is using "-1" the best way to set repeat to infinite?

 

Yup!

 

Glad you found the Jump Start downloads useful. We're hoping folks will spend some time "peaking behind the scenes" as its a great way to learn.

 

-Carl

Link to post
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.

×