Share Posted May 9, 2019 Is it possible? I have many divs with text that have different width. I want them to move at the same animation speed. This is my code: startRolling: function($text, $wrap) { let duration = $wrap.width() / 40; TweenMax.to($wrap, duration, { x: -($text.width()), ease: Linear.easeNone, repeat: -1 }); } So this doesn't work, and setting the duration manually to for instance .9 obviously doesn't work. Thanks! Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 @helleholmsen, There are a few times in the past where I've shown how to deal with similar speeds over different distances. Maybe these can help, See the Pen grLqYB by sgorneau (@sgorneau) on CodePen See the Pen mWEddP by sgorneau (@sgorneau) on CodePen I'll try to find others (I wasn't very good at categorizing them ? ) 5 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 My two cent approach: See the Pen ardXWP by PointC (@PointC) on CodePen Happy tweening. 5 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 xPercent: -100, x: window.innerWidth 1 2 Link to comment Share on other sites More sharing options...
Author Share Posted May 9, 2019 Thank you @Shaun Gorneau the last one with the text was exactly what I needed! Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 Very nice indeed, @PointC and @Shaun Gorneau 2 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 51 minutes ago, PointC said: My two cent approach: Very elegant Craig... a thought on how to make it responsive. See the Pen byEZqK by Visual-Q (@Visual-Q) on CodePen 4 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 Sweet work @Visual-Q ? Looks like this thread is getting pretty clever. I think we have one of these happening. 2 2 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 An extension to the previous pen... In typical fashion around here, one thing leads to another and gets completely off the original topic. Extending Craig's elegant x: window.innerWidth I think I might have come up with a fairly decent option for making transform based animations responsive. It basically uses the parent element as a stage and modifier to animate relative to it. See the Pen XwXQGV by Visual-Q (@Visual-Q) on CodePen 3 Link to comment Share on other sites More sharing options...
Share Posted May 9, 2019 You guys are having way too much fun with this Love it. 1 Link to comment Share on other sites More sharing options...
Share Posted May 14, 2019 Look at you lot, making translating boxes on a screen fashionable. 2 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