npm install marionette-css-animated-region
<script src="backbone.js" type="text/javascript"></script>
<script src="backbone.marionette.js" type="text/javascript"></script>
<script src="marionette-css-animated-region.js" type="text/javascript"></script>
var CSSAnimatedRegion = require('marionette-css-animated-region');
import CSSAnimatedRegion from 'marionette-css-animated-region';
var SomeViewConstructor = Marionette.View.Extend({
regions: {
animated: {
el: '.region-selector',
regionClass: CSSAnimatedRegion,
state: {
shown: {
opacity: 1
},
hidden: {
opacity: 0
},
animationDuration: 200,
animationFunction: 'ease'
}
}
}
})
For more information see examples in this repo.