Jump to content
Search Community

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

nplearn test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

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

  • Solution

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 comment
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.
×
×
  • Create New...