nplearn Posted May 13, 2021 Share Posted May 13, 2021 Hi there, I am using the following version, I am getting the attached warning the much I browse the site, I would love to resolve this; any guidance is appreciated. https://cdn.jsdelivr.net/npm/gsap@3.6.0/dist/gsap.min.js?ver=1.0 Thank you, nplearn. Link to comment Share on other sites More sharing options...
OSUblake Posted May 13, 2021 Share Posted May 13, 2021 Perhaps you meant to use duration? gsap.to(".foo", { x: 100, duration: 2.5 }); 5 Link to comment Share on other sites More sharing options...
nplearn Posted May 14, 2021 Author Share Posted May 14, 2021 Thank you, OSUblake, What I have in place is as below: var durationTime = 2.5; if ($(".gb").length) { var hb = gsap.timeline(); bh.fromTo( ".b-content", { opacity: 0 }, { durationTime, opacity: 1 } ); hb.play(); } Is it the way I have defined duration and the order of the variables causing the warning? As I tried with developer tool to the suggested fix then too it seem to giving me error, any suggestion what I may be doing wrong? Thank you, nplearn Link to comment Share on other sites More sharing options...
Solution OSUblake Posted May 14, 2021 Solution Share Posted May 14, 2021 There is no durationTime. Just duration. var duration = 2.5; if ($(".gb").length) { var hb = gsap.timeline(); hb.fromTo( ".b-content", { opacity: 0 }, { duration, opacity: 1 } ); } Or like this. var durationTime = 2.5; if ($(".gb").length) { var hb = gsap.timeline(); hb.fromTo( ".b-content", { opacity: 0 }, { duration: durationTime, opacity: 1 } ); } Also, you only need to call .play() if the animation is paused. 3 Link to comment Share on other sites More sharing options...
nplearn Posted May 17, 2021 Author Share Posted May 17, 2021 Thank you, OSUblake. It worked, I very much appreciate your help on this. Thank you, nplearn. 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