Jump to content
Search Community

Error for common gsap.set use...

bigmamainthemud test
Moderator Tag

Recommended Posts

Anyone know why I'd get an error for using code as seemingly innocuous as this?

    gsap.set(navbar, {alpha:0});

I'm getting: "Invalid property alpha set to 0 Missing plugin? gsap.registerPlugin()"

I did not think that was part of a special plugin set, what plugin would that be?

 

Thanks!

Link to comment
Share on other sites

Oops, yeah I just discovered that the target DID NOT exist so it's on me. =P my bad but thanks!

However, about the "alpha" vs "opacity" situation... yes, you are right about me coming from the Flash world 150 thousand years ago but... "opacity" is a long word... like "duration"... while I respect (and will eventually comply) with your language choices, I like short words. I am sure there are tons of arguments for why opacity (the css term) or duration ("time" probably has a conflict in gsap world but I like putting "duration" as a number in the 2nd arg.) etc.

Here's an example (showing my Flash beginnings). I wrote this because console.log was just too many letters for me and only takes one argument. This is specifically designed for chrome and doesn't work in Safari:

 

function trace(){
    // TO BE COMMENTED OUT ON UPLOAD
    var traceStr = '';
    for(var i = 0; i < arguments.length; i++){
        if(arguments[i] === undefined || arguments[i] === null) traceStr += arguments[i];
        else traceStr += arguments[i].toString();
        if(i < arguments.length - 1) traceStr += ', ';
    }
    if(new Error().stack !== undefined){
        var lineNum = ((new Error()).stack.split('\n')[2]).split('/').pop().split(')')[0];
        traceStr += '   <' + lineNum +'>';
    }
    console.log("%c"+traceStr, "background:black; color: white");
}

 

  • Like 1
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...