Skip to content

Instantly share code, notes, and snippets.

@matsko
Created August 29, 2013 18:20
Show Gist options
  • Save matsko/6381541 to your computer and use it in GitHub Desktop.
Save matsko/6381541 to your computer and use it in GitHub Desktop.
<style>
//CSS
.show-hide.ng-hide-add,
.show-hide.ng-hide-remove {
transition:0.5s linear all;
-webkit-transition:0.5s linear all;
-moz-transition:0.5s linear all;
-o-transition:0.5s linear all;
display:block!important;
}
.show-hide.ng-hide-add { ... }
.show-hide.ng-hide-add.ng-hide-add-active { ... }
.show-hide.ng-hide-remove { ... }
.show-hide.ng-hide-remove.ng-hide-remove-active { ... }
</style>
<script>
//JS
ngModule.animation('.show-hide', function() {
return {
addClass : function(element, className, done) {
if(className == 'ng-hide') {
animate(..., done);
}
else {
done();
}
},
removeClass : function(element, className, done) {
if(className == 'ng-hide') {
element[0].style.setProperty('display','','!important');
animate(..., function() {
element[0].style.removeProperty('display');
done();
}
}
else {
done();
}
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment