Share Posted January 17, 2015 I want to get a fill for an svg to scroll through multiple colors. I've done it this way but I'm not sure if there is a better way of doing it? var hand = $("#left-hand-palm"); var colors =["#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#ED1C24","#FFF200","#00A651","#00AEEF","#2E3192","#EC008C","#FF0000"]; tl = new TimelineMax({repeat:-1}); for (j = 0; j < colors.length; j++) { tl.to(hand, 1, {fill:colors[j], ease:Linear.ease}); }; See the Pen EaWqZm by LegendT (@LegendT) on CodePen 1 Link to comment Share on other sites More sharing options...
Share Posted January 19, 2015 Nice job. That is probably exactly what I would recommend. Don't see anything wrong with that. 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