Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
nplearn

Invalid property durationTime set to 2.5 Missing plugin? gsap.registerPlugin()

Go to solution Solved by OSUblake,

Recommended Posts

Perhaps you meant to use duration?

 

gsap.to(".foo", {
  x: 100,
  duration: 2.5
});

 

  • Like 5
Link to post
Share on other sites

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 post
Share on other sites

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.

 

  • Like 3
Link to post
Share on other sites

Thank you, OSUblake.

 

It worked, I very much appreciate your help on this.

 

Thank you,

nplearn.

  • Like 1
Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×