在下面的代码中,两个状态都具有相同的动画属性。如何为每个状态分配不同的动画属性?
for check in aniCheck
check.states.add
one:
opacity: 1
scale: 1
two:
scale: 0
check.states.animationOptions =
curve:"spring(400,25,50)"
delay: 2
iconFav.on Events.Click, ->
check.states.next("one","two")
答案 0 :(得分:0)
您可以在切换事件之前运行一个函数。
check.on Events.StateWillSwitch, (oldState, newState) ->
if newState == 'one'
check.animationOptions =
curve: 'spring(400,25,50)'
delay: 2
if newState == 'two'
check.animationOptions =
curve: 'linear'
delay: 0
我只是在学习并构建这个Framer JS example以供参考