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

Remove transition-duration style after move? #4

Closed
martypdx opened this issue Jul 7, 2011 · 6 comments
Closed

Remove transition-duration style after move? #4

martypdx opened this issue Jul 7, 2011 · 6 comments

Comments

@martypdx
Copy link

martypdx commented Jul 7, 2011

After completing a move animation, the [-vendor]-transition-duration style is still on the element, which will alter other interactions outside of move.js. Current workaround is to remove it by passing callback to final end().

Perhaps the top-level end() should remove this style as part of move.js?

@tj
Copy link
Member

tj commented Jul 7, 2011

ah, yeah that sounds like a bug to me

@rstacruz
Copy link
Member

Oh, I just sent a pull req on this which was just merged:

#10

Perhaps this issue can be closed now?

@martypdx
Copy link
Author

Hmm, been awhile since I looked at this.

Strictly speaking the merge didn't include transition-duration, just transition and transition-property. Move also uses transition-timing-function and a few other ones.

Also, shouldn't the state of the element be restored to whatever it was, not necessarily null? Perhaps the best thing would be to store those at the start (and potentially remove them so they don't interfere with what Move does) and then put them back at the end. Move would then also be side-effect free after being run.

@sgreenfield
Copy link

This is still a bug. Currently working around it with a bit of a hack. Any time I use move.js, I have to append this to an animation.

      .end(function(){
        move('#example').duration(0).end(); //remove the duration property for bug 
      });

This is needed to avoid an unwanted trigger of the animation when later changing the css attributes after having already done an animation with move.js.

It would be nice to be able to destroy an instance of move.js, or at least have the duration removed.

@yields yields closed this as completed in 67c769a Sep 28, 2013
@kimmobrunfeldt
Copy link
Contributor

I have a situation where I animate button, and after animation I want the button to have CSS hover animation.

 move('#button')
    .rotate(360)  // Some animations
    .set('opacity', 0.75)
    .then()
        .set('opacity', 1)  
        .pop()
    .end(function() {
        // Now I want to add a CSS class which will add nice hover animation to
        // the button
        $('#button')
            .removeAttr('style')  // This removes stuff like -webkit-transform: rotate(360deg) from the style attribute
            .addClass('opacity-hover')

        // However the animation does not work since the animation duration was
        // set to 0ms by move.js: style="-webkit-transition: 0ms;"
    });

Now I cannot achieve this because the animation duration style properties are set to '0ms' in this line:

this.el.style.oTransitionDuration = 0;

I fixed this by setting the style properties to empty string instead of 0.

@kimmobrunfeldt
Copy link
Contributor

I created a quick pull request of how I fixed it myself. There might be other scenarios where my fix does not work at all.

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

5 participants