Kejas Posted December 15, 2019 Share Posted December 15, 2019 Hi, with GSAP3 I cant seem to animate an element to the set duration in code like this: tl.fromTo(".stagecover", {duration:5, autoAlpha:1}, {autoAlpha:0}); Animation runs always for around 0.5 seconds disregarding the duration. Please help. See the Pen dyPpjxy by kutuhal (@kutuhal) on CodePen Link to comment Share on other sites More sharing options...
mikel Posted December 15, 2019 Share Posted December 15, 2019 Hey @Kejas, from the DOCS fromVars - An object containing the initial (starting) property/value pairs. You do NOT put special properties here like duration, delay, etc. - those go in the toVars So put the duration into the toVars ! Happy Tweening ... Mikel 4 1 Link to comment Share on other sites More sharing options...
OSUblake Posted December 15, 2019 Share Posted December 15, 2019 Your demo has errors. It's ease: "none" not ease: none. Think of a fromTo as just a set and to. You don't put stuff like duration or easing in a set. gsap.set(".stagecover", { autoAlpha: 1 }); gsap.to(".stagecover", { autoAlpha:0, duration: 5, ease: "none" }); // or gsap.fromTo(".stagecover", { autoAlpha: 1 }, { autoAlpha:0, duration: 5, ease: "none" }); 4 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