powerkaifu Posted June 11, 2022 Share Posted June 11, 2022 const date = new Date() gsap.to('#hour', { innerHTML: date.getHours() }) Hi All, when animation is rendering,can I control number is integer. it's floats now <== Link to comment Share on other sites More sharing options...
GreenSock Posted June 11, 2022 Share Posted June 11, 2022 Sure, just use the built-in snap feature. Here's one that rounds to the closest 0.1: See the Pen 8545124ffe95b3c9cbeed653d10034b9?editors=0010 by GreenSock (@GreenSock) on CodePen And you can change that to snap to the nearest 1 to keep it an integer - I just wanted to make it more visible/obvious by setting it to 0.1. 1 Link to comment Share on other sites More sharing options...
powerkaifu Posted June 11, 2022 Author Share Posted June 11, 2022 Gratz!Thanks,I already resolved it! 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