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

Can't go back to -100 in top value after setting 0 #51

Closed
Tatsh opened this issue Oct 15, 2011 · 1 comment
Closed

Can't go back to -100 in top value after setting 0 #51

Tatsh opened this issue Oct 15, 2011 · 1 comment

Comments

@Tatsh
Copy link

Tatsh commented Oct 15, 2011

  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;
      }
    }
@benbarnett
Copy link
Owner

This is working in the latest versions

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