Skip to content

Instantly share code, notes, and snippets.

@Splaktar
Created May 16, 2014 01:01
Show Gist options
  • Save Splaktar/94263470d198626bcd49 to your computer and use it in GitHub Desktop.
Save Splaktar/94263470d198626bcd49 to your computer and use it in GitHub Desktop.
AngularJS Animations (ng-enter, ng-leave, fade, slide) in a ng-repeat div
.fade {
transition:0.5s linear all;
}
.fade.ng-enter-stagger,
.fade.ng-leave-stagger {
transiton-delay:0.1s;
transition-duration:0s;
}
.fade.ng-enter {
opacity:0;
}
.fade.ng-enter.ng-enter-active {
opacity:1;
}
.fade.ng-leave {
opacity:1;
}
.fade.ng-leave.ng-leave-active {
opacity:0;
}
.slide-from-left {
position:relative;
}
.slide-from-left.ng-enter {
left:-50px;
}
.slide-from-left.ng-enter.ng-enter-active {
left:0px;
}
.slide-from-left.ng-leave {
left:0px;
}
.slide-from-left.ng-leave.ng-leave-active {
left:-50px;
}
angular.module('app', ['ngRoute', 'ngAnimate'])
.config(...
...
<script type="text/javascript" src="https://code.angularjs.org/1.2.6/angular-animate.min.js"></script>
...
<input type="text" class="searcher" placeholder="Filter Stations" ng-model="search" />
<div class="container row">
<div class="six columns">
<h1>Line</h1>
<div ng-repeat="station in lineStations | filter:search" class="fade slide-from-left">
<h2>
<a ng-href="#!/stations/{{ station.id }}">{{ station.title }}</a>
</h2>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment