Monday, 15 February 2010

javascript - angular 1.2 apply animation based on class -



javascript - angular 1.2 apply animation based on class -

i made html layout works filter , html looks this

<div class="filter"> <small>user</small> <em ng-bind="filter.name">all users</em> <nav> <a class="selected" ng-click="filter={name: 'all users', filter: ''}">all users</a> <hr> <a ng-click="filter={name: 'person1', filter: 'person1'}">person1</a> <a ng-click="filter={name: 'person2', filter: 'person2'}">person2</a> <a ng-click="filter={name: 'person3', filter: 'person3'}">person3</a> </nav> </div>

now approach created directive , when press on filter, adds active class near filter class, , css when active class applied, show

.filter nav { display: none; } .filter.active nav { display: block; }

now question is, there way can show / hide of nav div animated using angular 1.2 animation library?

thank in advance, daniel.

you might want review nganimate documentation hide/show animation comes (along others) comes free. need reference nganimate, inject $animate , add together enter/leave css styles.

javascript html css angularjs

No comments:

Post a Comment