javascript - ngAnimate replace one div with another -
lets have following:
<div class="container"> <div class="row> <div id="first" ng-show="condition" class="in-out">content here...</div> <div id="second" ng-hide="condition" class="in-out">other content here...</div> </div> </div> <style> .in-out.ng-hide-add, .in-out.ng-hide-remove { transition:1s linear all; } .in-out.ng-hide-add { //opacity: 0; } .in-out.ng-hide-add.ng-hide-add-active { opacity: 0; } .in-out.ng-hide-remove { //opacity: 1; } .in-out.ng-hide-remove.ng-hide-remove-active { opacity: 1; } </style>
how can gracefully replace 1 div other. means following:
- first visible, second not
- condition changes - first fades away
- second fades in in place of first
- all without altering size of main container
Comments
Post a Comment