Created
August 29, 2013 18:20
-
-
Save matsko/6381541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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