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

Animating breaks css padding? #25

Closed
kirkins opened this issue Mar 3, 2017 · 2 comments
Closed

Animating breaks css padding? #25

kirkins opened this issue Mar 3, 2017 · 2 comments

Comments

@kirkins
Copy link

kirkins commented Mar 3, 2017

I'm using animate translate x to move an element 100 to the right. Then after that I do the same thing but -100 in an attempt to return it to the original position.

But the final position of the card is off because the original css padding is not acknowledged.

Code:


function drawCard() {
  animate({
    el: "#card",
    translateX: 100,
    opacity: 0,
    duration: 500,
    complete: animateCard
  }); 
}

function animateCard() {
  animate({
    el: "#card",
    translateX: -100,
    opacity: 1,
    duration: 500 
  }); 
}
@bendc
Copy link
Owner

bendc commented Mar 5, 2017

Please read the documentation, the problem you're experiencing is just a wrong usage of the API.

@bendc bendc closed this as completed Mar 5, 2017
@kirkins
Copy link
Author

kirkins commented Mar 5, 2017

You mean the 1 page README that says this javascript animation library is a css animation library? That's where I copied the function from.

Animating over-rides default css properties but I guess that is your desired behaviour.

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