Jump to content
Search Community

Animating background position - jumping

gareth 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 have a background svg, which I am using a steppedEase to move the background position. This works fine, but if I run the tween twice (e.g double click) or try and change the tween while it is running, the stepped effect is lost and it just scrolls the object along. Is there a strategy to avoid this?  

var steppedEase = new SteppedEase(16);
TweenLite.to($('#mobToggle'), .55, {backgroundPosition: '-'+(24*16)+'px -240px', ease:steppedEase})
Link to comment
Share on other sites

Could you please provide a sample of some kind so we can see this in action? It's very difficult to understand what your issues are with clicking and changing the tween when you haven't provided any information about that.




My hunch is that the wrong number of steps are being used when creating a tween on mobToggle with backgroundPosition != "0px -240px", which would make the sprite look like it was also sliding.

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