I wan't to get a slideIn / slideOut animation by toggling the classes slideInRight and slideOutRight to a ul element.
I've tried it in different ways but I it only works with one className.
How can I add the class slideInRight on the first, and the class slideOutRight on the second click on my ul element with the class dropdown-menu?
I've tried it this way:
angular.element('.dropdown-toggle').on('click', function(){
angular.element('ul.dropdown-menu').toggleClass('slideOutRight slideInRight');
});
What am I doing wrong?
Hope you can help.
UPDATE:
Here is a Plunker of the current state of my code. This way only the slideInRight animation works. If I click the button again, the ul disappears without the slideOutRight animation.
What's wrong?
You may want to try using angular's
ng-class
?I'm sort of new to angular, but the way I did it was like this:
and the js