-1

I've already read angular2-height-animation-same-state-transition but was not helpful

I'm making a carousel like the ones you see on ebay or amazon sites, in the 'recently viewed items' section. The objects are placed horizontally and can be scrolled left and right several times, depending on how many objects you have seen recently.

In the official documentation of angular animations I have not found any example on how to trigger the same state. Transactions are dynamic because it is not known how many objects will be displayed and also the size of the window could be reduced so it will take more transactions to display all the objects compared to a fullscreen window.

I plan to create 2 states left and right and 2 transitions:

  • => right
  • => left

The problem arises when I have to trigger to change same state.

Going from a left to right state (it means displaying the objects that are beyond the right edge of the screen) if I wanted to scroll again to the right, (therefore right => right) I am already be in a right state and therefore nothing is triggered .

How can I implement these features?
I hope I have been clear, thank you!

CaneRandagio
  • 366
  • 2
  • 15

1 Answers1

2

I found the solution to the problem, after going to any state (right or left), through the callback I change the state to 'pause' without any change of style, so I can still scroll on the same side.

CaneRandagio
  • 366
  • 2
  • 15