Ember.js Router: How to animate state transitions

后端 未结 6 646
情歌与酒
情歌与酒 2020-12-29 22:22

Has somebody found a good way to animate state transitions?

The router immediately removes the view from the DOM. The problem with that is that I can\'t defer that u

6条回答
  •  醉梦人生
    2020-12-29 23:04

    I've found another drop-in solution that implements animations in Views: ember-animate

    Example:

    App.ExampleView = Ember.View.extend({
    
        willAnimateIn : function () {
            this.$().css("opacity", 0);
        },
    
        animateIn : function (done) {
            this.$().fadeTo(500, 1, done);
        },
    
        animateOut : function (done) {
            this.$().fadeTo(500, 0, done);
        }
    }
    

    Demo: author's personal website

提交回复
热议问题