Tanuki Posted August 1, 2021 Share Posted August 1, 2021 Can anyone tell me what the 2nd tween parameter is used for? I'm sure it's staring me in the face, but I can't seem to find any description of the numerical param that immediately follows the target - thx in advance! Link to comment Share on other sites More sharing options...
Solution akapowl Posted August 1, 2021 Solution Share Posted August 1, 2021 Hey @IMTanuki It's the duration of the tween. Quote I'm sure it's staring me in the face, but I can't seem to find any description of the numerical param that immediately follows the target Have you checked the docs? https://greensock.com/docs/v2/TweenLite var photo = document.getElementById("photo"); TweenLite.to(photo, 2, {width:"200px", height:"150px"}); The above code will tween the width and height properties of the <img> DOM element with an id of "photo" from whatever the current values are to 200 and 150 respectively over the course of 2 seconds. TweenLite is part of a rather old version by now though. You might want to consider updating to GSAP3 - it's pretty easy. The syntax of the duration parameter has changed a bit since then. 3 Link to comment Share on other sites More sharing options...
Tanuki Posted August 1, 2021 Author Share Posted August 1, 2021 Hmmm...so, my question was prompted by what I saw in the docum - I just started using GSAP, so I've never even used v2. I started on the MorphSVG product page, then - navigated to the MorphSVG plugin docum, which defaults to v2 and that spawned my question. Based on your input, I toggled to v3, which navigates to the docum home page, at which point I was able to find the v3 MorphSVG plugin docum. So I'm glad I asked and thank you for the quick reply. But it seems like the docum navigation is a bit circuitous... Link to comment Share on other sites More sharing options...
GreenSock Posted August 2, 2021 Share Posted August 2, 2021 Sorry about the confusion there. It looks like you found the one link on the entire MorphSVG page that did indeed go to the v2 docs. Glad you pointed that out! Should be fixed now. Also, for the record, our docs remember which version you were browsing and defaults to that thereafter as a convenience. So if you landed in the v2 docs, you'll stay there unless you toggle to v3 (or go directly to one of the v3 links of course). Hopefully that clears everything up now. Enjoy the tools! 👍 3 Link to comment Share on other sites More sharing options...
Tanuki Posted August 13, 2021 Author Share Posted August 13, 2021 Thx! BTW, this forum app is really great! 1 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