Backbone Marionette - Add a visual effect when switching view

后端 未结 5 581
半阙折子戏
半阙折子戏 2020-12-23 18:16

Is there a convenient way to add an effect when I leave a page (close a view/layout) and open a new one in the same region ? (something like a fade effect)

5条回答
  •  醉话见心
    2020-12-23 18:34

    You could override the close function on the view, doing something like this:

    close: function () {
      // fancy fade-out effects
      Backbone.Marionette.View.prototype.close.apply(this, arguments);
    }
    

    And do something similar with your render functions.

提交回复
热议问题