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

Duration property problem when I use an event #881

Open
rod203 opened this issue Jan 31, 2024 · 0 comments
Open

Duration property problem when I use an event #881

rod203 opened this issue Jan 31, 2024 · 0 comments

Comments

@rod203
Copy link

rod203 commented Jan 31, 2024

I'm creating a pointer click animation using mouseDown and mouseUp event and when the animation has duration (any value except 0) the animation doesn't work. When I put the duration on 0 the element scale but with out animation.

Here is the code

const toggleDown = () => {
  anime.remove(cursorInner);
  anime({
    targets: cursorInner,
    duration: 1000,
    scale: 2,
    easing: "easeInOutSine",
  });
};
const toggleUp = () => {
  anime.remove(cursorInner);
  anime({
    targets: cursorInner,
    duration: 1000,
    scale: 1,
    easing: "easeInOutSine",
  });
};

document.addEventListener("mousedown", toggleDown);
document.addEventListener("mouseup", toggleUp);
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

1 participant