Share Posted March 11, 2016 Hi all. Quick question. I'd like to tween the kerning/letter spacing on a line of text. Got it working but have a couple specific inquiries. I wasn't able to locate the exact documentation for the letterspacing tween effect. My line of code is: TweenMax.fromTo("#text1", 1, {letterSpacing:20, alpha:0}, {letterSpacing:10, alpha:1}); I'd like to add a delay and also I want the text to tween from the center rather than from the left - how do I do that as well? Here is the CSS: #text1 { font-family: 'Anderson 1938', 'anderson_1938regular', 'Helvetica', sans-serif; font-size:28px; font-weight:400; letter-spacing: 10px; color:#fff; position:absolute; top:38px; left:121px; text-align:center; z-index:10; } I thought maybe the text-align:center; would get it to animate from the center but no such luck. Thanks in advance for any direction! Link to comment Share on other sites More sharing options...
Share Posted March 11, 2016 Hi sorciereus If you want to see a really nice 'from the center' text animation, you should take a look at this pen from Diaco. (one of our forum superheros) See the Pen OVqBBq by MAW (@MAW) on CodePen That pen is using the SplitText plugin which is a Club Membership perk, but may be exactly what you need. Hopefully that helps a bit. Happy tweening. 5 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2016 Great advice, PointC and nice job finding the Diaco pen. The perfect approach! Link to comment Share on other sites More sharing options...
Share Posted March 13, 2016 Hi sorciereus pls add this to your css : transform: translate(-50%,0%); and yep , for the separate delays and smoothest tween ( use x/y & subpixels instead of letterSpacing and pixels ) that's better to use GSAP SplitText plugin . 4 Link to comment Share on other sites More sharing options...
Author Share Posted March 14, 2016 Thanks very much for the replies. I appreciate both solutions and SplitText is super smooth! Rad! 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