Skip to content

Instantly share code, notes, and snippets.

@hbuchel
Created March 6, 2014 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbuchel/9399666 to your computer and use it in GitHub Desktop.
Save hbuchel/9399666 to your computer and use it in GitHub Desktop.
Using ng-animate with ng-show/ng-hide to transition the opacity of an element. (extendible sass class)
/*************************************************
* Structure for ng-show/ng-hide animations
* .animationName {
// CSS While ng-show is true
* &.ng-hide-add, &.ng-hide-remove {
* display: block !important;
* }
* &.ng-hide {
* // CSS while ng-hide is true
* }
* }
*************************************************/
/* Transitioning the opacity of an ng-show-item */
%opacityShowHide {
@include single-transition(opacity,.3s,ease-in-out);
opacity: 1;
&.ng-hide-add, &.ng-hide-remove {
display: block !important;
}
&.ng-hide {
opacity: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment