Share Posted June 26, 2014 I have a situation where a slideshow is dissolving between images. I am using TimelineMax and allowing the slideshow to loop endlessly. I need to give the user the ability to pause and restart the slideshow... easy enough using pause(). However I would like to make sure that if an image has already started tweening (dissolving into the next image), that the tween doesn't pause part way through... resulting in two semi-transparent images on top of each other. Is there a way to pause the timeline but allow any existing tweens to complete first? Link to comment Share on other sites More sharing options...
Share Posted June 26, 2014 Not exactly. You can place labels in your timeline after these cross-fades complete. //transition in slide2 tl.add("slide2") tl.to(img1, 1, {opacity:0}, "slide2") tl.to(img2, 1, {opacity:1}, "slide2") //transition in slide3 tl.add("slide3") tl.to(img2, 1, {opacity:0}, "slide3") tl.to(img3, 1, {opacity:1}, "slide3") tl.add("slide4") Then when the user wants to pause the timeline, instead of calling pause() you can use TimelineMax's getLabelAfter() to figure out what the next label is and then either //jump to the next label and pause pause(tl.getLabelAfter()); //or // smoothly tween to the next label tl.tweenTo(tl.getLabelAfter()); Check the TimelineMax docs for more info on getLabelAfter(): http://api.greensock.com/js/ 4 Link to comment Share on other sites More sharing options...
Author Share Posted June 26, 2014 Ah! Awesome + THANKS! Link to comment Share on other sites More sharing options...
Share Posted June 26, 2014 Carl, I was very curious about the same question. Thanks for the explanation! 1 Link to comment Share on other sites More sharing options...
Share Posted June 27, 2014 You are both very welcome. 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