I'm trying to create a small animation when button is clicked it will show a div and hide when its clicked again. searchPanel is opacity 0 in the css was hoping a toggle effect rather than showing/hiding.
<button class="searchCtrl" ng-click="clickthis">Toggle</button>
<div class="searchPanel" ng-show="showthis">
<form action="">
<input type="text" placeholder="Enter postcodde" class="form-control input-sm mb-10">
<select name="jobtype" id="" class="form-control input-sm">
<option value="permanent">Permanent</option>
<option value="parttime">Part-time</option>
<option value="contract">Contract</option>
</select>
</form>
</div>
.searchPanel{
position: relative;
z-index: 0;
left: 0;
background: rgba(0, 0, 0, 0.7);
display: inline-block;
padding: 15px;
//opacity: 1;
}
button{
position: relative;
display: block;
}
答案 0 :(得分:0)
You can use this:
<button class="searchCtrl" ng-click="showthis=!showthis">Toggle</button>
to show/hide the animation. here is a pluncker: pluncker
答案 1 :(得分:0)