angularjs - ngAnimate on ngShow. Preventing animation when it starts first time -
i playing around added angular.js animations feature, , doesn't work desired
<style> .mydiv{ width:400px; height:200px; background-color:red; } .fadein-setup,.fadeout-setup { -webkit-transition: 1s linear opacity; -moz-transition: 1s linear opacity; -o-transition: 1s linear opacity; transition: 1s linear opacity; } .fadein-setup{ opacity:0; } .fadeout-setup{ opacity:1; } .fadein-setup.fadein-start { opacity: 1; } .fadeout-setup.fadeout-start{ opacity:0; } </style> <div ng-app> <div ng-controller='ctrl'> <input type='button' value='click' ng-click='clicked()' /> <div ng-show="foo == true" class='mydiv' ng-animate="{show: 'fadein', hide:'fadeout'}"> </div> </div> </div> function ctrl($scope){ $scope.foo = false; $scope.clicked = function(){ $scope.foo = !($scope.foo); } }
it spoils away mydiv on dom.ready
, starts fading out. whereas should hidden. how fix that?
this has been fixed now. upgrade 1.1.5.
Comments
Post a Comment