Is it possible to do conditional handler in AMP?

117 Views Asked by At

I need to show/hide menu only using amp-animation. I created two different amp-animations showMenu and hideMenu. My first attempt was to do something like that

<div on="tap:AMP.setState({ menu: { open: !menu.open }}),menu.open ? hideMenu : showMenu">

Which didn't work because apparently you cannot put conditional logic on top level but can inside setState function. Is there anything I can do?

0

There are 0 best solutions below