jquery - How to continuous animation in Tweenmax ? -
I'm constantly trying to animate an image left to right and I want to repeat it Repeat (from left to right only). I wrote this way.
& lt; Script & gt; TweenMax.to (". Image", 40, {left: '960px', Completed: function () {$ (".movie"). CSS ({"left": "- 50px"}); TwinMX.T.To ".image", 40, {repeat: -1,}}}}) & lt; / Script & gt; & Lt; Div class = "image" & gt; & Lt; / Div & gt;
You can use a simple function definition to do this;
& lt; Script & gt; Function animateImage () {$ (".movie"). CSS ({"left": "- 50px"}); TweenMax.to (". Image", 40, {left: '960px', complete: animateImage}); } & Lt; / Script & gt; & Lt; Div class = "image" & gt; & Lt; / Div & gt;
Comments
Post a Comment