Search the Community
Showing results for tags 'inline styles'.
Hi, I have a basic timeline that tweens the opacity of list items in various ways. When certain things happen on screen I need to clear the timeline completely and also reset the elements back to their original starting values. 1st attempt: Just using restart() on the timeline expecting it to clear the existing inline "style" attribute. The timeline restarts nicely but it starts with the current inline values of the elements (eg: style="opacity: 0.89434") which ruins the animations because all the timings go off. 2nd attempt: Using invalidate() on the TimelineMax object to clear the existing values. This appears to have no effect, the inline styles are still in place after making the call. Calling restart() after an invalidate still has the same effect as attempt 1. 3rd attempt: Using clear() on the TimelineMax object and just re-adding all the TweenMax object to the timelines each time I want to play it. Clearing does indeed clear the tweens from the timeline, but does not reset the inline values so any subsequent tween will just start from the values it left off on. Because the inline styles pretty much have the highest specificity I can't override easily by applying any CSS, I'll have to resort to stripping inline styles (manually or with jQuery) when getting rid of the tweens unless there is something built in to restore the elements back to when there was no tweening applied to them? All the various 'kill' methods also don't get rid of the inline styles but at least it appears to reset when applying it again. Please help, there's gotta be something simple to solve this problem. Regards, Werner