benbarnett/jQuery-Animate-Enhanced — Issue #51: Can't go back to -100 in top value after setting 0
Author: tatsh
Created: 2011-10-15 22:16:34+00:00
State: open

```
if ($errorMessages.size() > 0) {
$errorMessages.animate({'top': 0}, 'fast', function () {
setTimeout(function () {
$errorMessages.animate({'top': -100}, 1000);
}, 2000);
});
}
```

Maybe it has to do with setTimeout?

I propose the following change in the _applyCSSTransition() function:
```
// fix 0 issue (transition by 0 = nothing)
if (isTranslatable && offsetPosition === 0) {
if (meta[stashedProperty] > 0) {
offsetPosition = 0 - meta[stashedProperty];
}
else {
offsetPosition = 0 + meta[stashedProperty];
}
meta[property] = offsetPosition;
meta[stashedProperty] = 0;
}
}
```