snazzybouche
snazzybouche

Reputation: 2424

How can I apply a horizontal sliding animation on ng-show and ng-hide?

Say I have four div blocks.

Each of them takes up the whole page in width, and only one is visible at a time . The user has 4 buttons they can press, each of which hides the currently-visible div and shows the one that they want to see.

I can implement this behaviour using ng-show, ng-hide, and the ngAnimate extension with ng-hide-add and ng-hide remove. For example, I can get one div to slide horizontally to the left and the next to slide in from the right.

However, this only visually works when the user is selecting the next div in the list. If the user selects the previous one, it still slides in from the right when by all rights it should slide in from the left.

How can I implement this behaviour?

Upvotes: 0

Views: 43

Answers (0)

Related Questions