Share Posted February 6, 2013 Hi, New to the javascript version of GSAP but have been using greensock for years Im trying to basically animate the scale of an image and also the opacity like this: $(document).ready(function(){ $('.photo').mouseover(function (e){ TweenMax.to($(this), .2, {scaleX:1, scaleY:1, css:{opacity:1}}); }) $('.photo').mouseout(function (e){ TweenMax.to($(this), .2, {scaleX:0.8, scaleY:0.8, css:{opacity:0.7}}); }) }) But it only seems to do the opacity, but if I take out the opacity it does the scale.am I missing something painfully obvious? thanks C Link to comment Share on other sites More sharing options...
Share Posted February 6, 2013 scale is a property to be tweened by CSSPlugin and should be inside the css object (with GSAP 1.8, you can also skip the css object altogether if you want) TweenMax.to($(this), .2, {css:{scaleX:0.8, scaleY:0.8, opacity:0.7}}); // or TweenMax.to($(this), .2, {scaleX:0.8, scaleY:0.8, opacity:0.7}); I think the mixing of styles is what caused your issue. 2 Link to comment Share on other sites More sharing options...
Author Share Posted February 7, 2013 Yes thats done it thanks! Link to comment Share on other sites More sharing options...
Share Posted March 21, 2018 On 2/6/2013 at 1:41 PM, jamiejefferson said: scale is a property to be tweened by CSSPlugin and should be inside the css object (with GSAP 1.8, you can also skip the css object altogether if you want) TweenMax.to($(this), .2, {css:{scaleX:0.8, scaleY:0.8, opacity:0.7}}); // or TweenMax.to($(this), .2, {scaleX:0.8, scaleY:0.8, opacity:0.7}); I think the mixing of styles is what caused your issue. Link to comment Share on other sites More sharing options...
Share Posted March 21, 2018 Luaskaaspary, I'm guessing your post above where you just quote jamie's answer from 5 years ago was a mistake. If you have an actual question please let us know, otherwise I'll delete it. no biggie. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now