Skip to content

Instantly share code, notes, and snippets.

@danielmackay
Created April 17, 2014 01:20
Show Gist options
  • Select an option

  • Save danielmackay/10946671 to your computer and use it in GitHub Desktop.

Select an option

Save danielmackay/10946671 to your computer and use it in GitHub Desktop.
Animated expander using ng-show. #angularjs
.expander {
-webkit-transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) .5s;
-moz-transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) .5s;
-o-transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) .5s;
transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) .5s;
height: 100px;
}
.expander.ng-hide {
height: 0px;
}
.expander.ng-hide-add,
.expander.ng-hide-remove {
display: block !important;
}
<button ng-click="toggleAdvanced()">Show Advanced</button>
<div class="expander" ng-show="showAdvanced">
ADVANCHED SEARCH OPTIONS HERE...
</div>
$scope.showAdvanced = false;
$scope.toggleAdvanced = function() {
$scope.showAdvanced = !$scope.showAdvanced;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment