Posted Oct 12 - Read on Facebook
Hey,
for some reason I can not get 'layer.states.next()' to work correctly. When I click my "BTNbuy" button the "cart_on" is displayed with cart_off's delay — and the cart_off does not happen at all.
I understand the delay thing, but don't see why "cart_off" state is not being triggered when using 'cart.states.next("cart_on", "cart_off")'.
#############
My code below:
#############
# cart states — show cart with .3sec delayed, and remove cart after 5 sec.
cart.states.add
cart_on:
y: 46
x: 1692
opacity: 1
scale: 1
cart.states.animationOptions = delay: .3
cart_off:
opacity: 0
cart.states.animationOptions = delay: 5
# button
BTNbuy.on Events.click, ->
cart.states.next("cart_on", "cart_off")
4 Comments