Share Posted September 19, 2013 Is there any way for all the timeline/tweens to reset back to starting position all at once and pause them there and wait until triggered to play/resume again except the currently triggered timeline?for example, I have 2 slides which identifies element if it was currently on the viewport and then fires the tween sequence inside a timelineMax. (don't mind the viewport identification as it was already done) I tried TweenMax.killAll(false, true, false); but what it did was, it pauses all the delayed and remaining tweens which leaves the current state of element. What I want is since these elements are came from autoAlpha:0, it will be set back to their starting timeline sequence and wait until being triggered again. That means when another timeline is triggered, it will abort all remaining tweens of the previous timeline and vise versa for both slides. The killAll scenario is, I can see the elements that are stopped and I don't want that. I want them to have all fresh entry everytime the sequence is triggered. I am sorry for this issue has been solved years ago. Sorry for opening same thread. Link to comment Share on other sites More sharing options...
Share Posted September 19, 2013 hello and welcome to the forums have you tried after using the kill methods to clearProps? ... go to the below link and scroll down to clearProps to read about it: http://api.greensock.com/js/com/greensock/plugins/CSSPlugin.htmlalso maybe something like this: var targetElement = document.getElementById("targetElement"); TweenMax.killAll(false,true,fasle); TweenMax.set(targetElement, {clearProps:"all"}); // or you can use "autoAlpha" as the value for clearProps Link to comment Share on other sites More sharing options...
Share Posted September 20, 2013 Hi, I'm not 100% clear on what you need to accomplish, but have you looked into TimelineLite's exportRoot() method? In short it allows you to grab all loose tweens and timelines and place them in a new TimelineLite that you can then reverse() or set progress(0); Link to comment Share on other sites More sharing options...
Share Posted September 20, 2013 Hey Carl.. when you use the exportRoot() method.. when using and exporting into another timeline, are the initial values reset to when the timeline was first created? thx Link to comment Share on other sites More sharing options...
Share Posted September 20, 2013 HI Jonathan, Check out this codepen to see exportRoot() in action. http://codepen.io/GreenSock/pen/5c4c6cd60274386b0d7c4e64810a0d3e If that doesn't help with your question, feel free to elaborate more. best, Carl 1 Link to comment Share on other sites More sharing options...
Author Share Posted September 24, 2013 Thank you for the very fast and very informative replies there folks. I am sorry if I am that too lazy on reading docs or related topics. I tried searching some time but it returns to be not the one I want. I had accomplished what I want with this code: myElementTL.pause(0); myElementTL.clear(); and then trigger it again to make it restart if my condition triggers its restart with this: myElementTL.restart(); ...Anyway, thank you for all the replies. I will try and reconfigure what I did if the above of your solutions are better. Thanks 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