Share Posted February 27, 2015 Greeting to GSAP Team! Great thanks for making this amazing tool! Now about my problem, please, if you can, help me with it. I'm trying to tween backgroundPosition, but it's isn't work with some properties. For example: // This is NOT work TweenMax.fromTo($(this).children('a'), 0.8, {backgroundPosition: 'center left'}, {backgroundPosition: 'center right'} ); And this: // Now it Work TweenMax.fromTo($(this).children('a'), 0.8, {backgroundPosition: 'center left'}, {backgroundPosition: 'top center'} ); The starting background position of element (css style) is "center left". Link to comment Share on other sites More sharing options...
Share Posted February 27, 2015 Hi nomn You set wrong values for X / Y , pls check values Order : backgroundPosition : ' Xpos Ypos ' http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-position http://www.w3schools.com/cssref/pr_background-position.asp 3 Link to comment Share on other sites More sharing options...
Share Posted February 27, 2015 Hello nomn, and Welcome to the GreenSock Forum! Have you tried using the equivalent of the position keywords.. which is using percentages: topEquivalent to 0% for the vertical position. rightEquivalent to 100% for the horizontal position. bottomEquivalent to 100% for the vertical position. leftEquivalent to 0% for the horizontal position. centerEquivalent to 50% for the horizontal position if it is not otherwise given, or 50% for the vertical position if it is. So your example that didn't work try this using percentages: // so instead of this: // This is NOT work TweenMax.fromTo($(this).children('a'), 0.8, {backgroundPosition: 'center left'}, {backgroundPosition: 'center right'} ); // try this // See if this works TweenMax.fromTo($(this).children('a'), 0.8, {backgroundPosition: '50% 0%'}, {backgroundPosition: '50% 100%'} ); : See if that helps? If not please create a codepen demo so we can better help test your code in a live environment. Here is a cool video tut by GreenSock on how to create a codepen demo example. Thanks! 3 Link to comment Share on other sites More sharing options...
Author Share Posted February 27, 2015 I'm so ashamed. Sorry for such a question. Thank you very much Link to comment Share on other sites More sharing options...
Share Posted February 27, 2015 No worries nomn.. we are here to help! Happy Tweening 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