Angular:
http://angularjs.org/
by mrajcok
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<div ng-controller="MyCtrl">
<button ng-click="animateToggle = !animateToggle">animate</button>
<div animate-me="animateToggle" ng-hide="true">div to animate</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.directive('animateMe', function() {
return function(scope, element, attrs) {
scope.$watch(attrs.animateMe, function() {
element.show(300).delay(900).hide(300);
})
}
});
function MyCtrl($scope) {
$scope.animateToggle = false;
}