Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining produces error "e.replace is not a function." #921

Open
crackwilding opened this issue Jul 31, 2020 · 1 comment
Open

Chaining produces error "e.replace is not a function." #921

crackwilding opened this issue Jul 31, 2020 · 1 comment

Comments

@crackwilding
Copy link

crackwilding commented Jul 31, 2020

Your system information

  • VelocityJS version: 2.06
  • Browser: Chrome
  • Operating System: OSX

I have code in a class that looks like this:

    this.image.velocity('property', { 
      left: (mousepos[0] - 6) + 'px',
      top: (mousepos[1] - 24) + 'px',
      opacity: 1
    }).velocity(
      { 
        left: (mousepos[0] - 6 + dest[0]) + 'px',
        top: (mousepos[1] - 24 - dest[1]) + 'px',
        opacity: 0
      },
      { duration: 3000 }
    );

When I run it it tells me "Uncaught TypeError: e.replace is not a function." This is in velocity.min.js, line 6, and the stack shows calling function as the second velocity call above. mousepos is a two-element array of screen x and y, as is dest. If I take out the opacity value in the second call, it works fine.

@Rycochet
Copy link
Collaborator

This will get fixed in v3, but the heart of the issue is that all css properties are actually strings - and somehow I skipped checking and fixing it in some circumstances - a quick fix would be to use opacity: "0", - but this is definitely a bug that needs handling (and testing for!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants