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 right prop from negative to 0 not properly handle #131

Open
jjmaceda opened this issue Aug 29, 2013 · 4 comments
Open

animating right prop from negative to 0 not properly handle #131

jjmaceda opened this issue Aug 29, 2013 · 4 comments

Comments

@jjmaceda
Copy link

if I try to animate

$('.mobile-menu').animate({
right: 0
},

when .mobile-menu has right -200px, the return value for the transition is 200 instead of 0, I track the issue to the private method _applyCSSTransition under

offsetPosition = value - cleanPropertyValue;

value = 0 and cleanPropertyValue = -200 so the offsetPosition give me 200

in needs something else to handle the values correctly thanks!

@hitchhiker
Copy link

Same problem animating from NEGATIVE on 'bottom'.

@hitchhiker
Copy link

In _function applyCSSTransition(e, property, duration, ... i changed:

offsetPosition = value - cleanPropertyValue;

To:

            if (property=='bottom' || property=='right')
                offsetPosition = value;
            else
                offsetPosition = value - cleanPropertyValue;

Horrible hack, untested, didn't investigate anything properly - just needed a solution. BEWARE!

@Kravimir
Copy link

Kravimir commented Oct 8, 2014

Thanks for posting that fix, hitchhiker. It makes the "right" property animate as expected.

I've run into this problem on multiple projects now. Ben, would you please fix this?

In case anyone would like to know, to apply hitchhiker's fix to the current minified version, you change
s=f-p;
to
s=(b=='bottom'||b=='right')?f:(f-p);

@isayeter
Copy link

thanks ! this works for "bottom" too !

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

4 participants