Angular: Empty Fiddle
http://angularjs.org/
by Tahsis Claus
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl" class="panelbar">
<label for="one">a</label>
<input type="radio" id="one" value="male" ng-model="box"/>
<div class="panel"></div>
<label for="two">a</label>
<input type="radio" id="two" value="female" ng-model="box"/>
<div class="panel"></div>
<div class="buffer"></div>
<button ng-click="close()">aaa</button>
</div>
CSS
* {
box-sizing: border-box;
}
input[type="radio"] {
-webkit-appearance: none;
display:none;
}
label {
display: block;
width:100px;
height:50px;
background-color:red;
border:1px solid black;
}
.panel {
height: 0px;
width: 100px;
background-color:pink;
transition:height 2s ease;
}
input:checked + .panel {
height: 100px
}
input:checked ~ .buffer {
height: 0;
}
button {
height: 50px;
width: 100px
}
.buffer {
width: 100px;
height: 100px;
background-color: blue;
transition:height 2s ease;
}
.panelbar {
width: 100px;
height: 250px;
background-color: orange;
border: 2px solid red;
box-sizing: content-box!important;
overflow: hidden;
}
JavaScript
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
myApp.controller('MyCtrl', ['$scope', function ($scope) {
$scope.box = "male";
$scope.close = function() {
$scope.box = "";
}
}]);
/*function MyCtrl($scope) {
$scope.name = 'Superhero';
}*/