visionmedia / move.js

CSS3 backed JavaScript animation framework
http://visionmedia.github.com/move.js/
4.72k stars 686 forks source link

Correct way to chain then() and end() ? #64

Closed ben-eb closed 9 years ago

ben-eb commented 9 years ago

I'm having problems with this code; I would expect that end would only be fired once the animation was complete:

    move(transition)
        .translateX(from)
        .duration(10)
        .then()
            .translateX(to)
            .duration(700)
            .ease('ease-out-quart')
            .then()
                .delay(1000)
                .translateY(window.innerHeight)
                .duration(350)
                .ease('ease-in-quart')
                .pop()
            .pop()
        .end(console.log.bind(console, 'test'));

Full code is here: http://jsbin.com/judoguvape/1/

Is there something special that I need to do in order so that the console.log is fired only at the end?