4

I have defined an angular animation like this

 trigger('sampleAnimation',[
  state('selected', style({
     transform: 'translateY(-90%) '
  })),
  state('normal', style({
  
    transform: 'translateY(*)'
  
  })),
  transition('normal <=> selected',animate(300))

])

]

Here in selected state, i want to translate the X part also , here i can give x position in pixel or percantage, but how can i move it to the center of the currently parent div of the element, the element can be on left or right side as its a stack of cards. How to calculate and set the translate X amount in angular animation ?

Shofiqul Alam
  • 585
  • 1
  • 7
  • 29

0 Answers0