I am trying to animate a sublayer in Framer.js on click. What I get is "Uncaught TypeError: layerD.on is not a function".
Am I doing something wrong or animating sublayers is not possible in Framer?
Here's the code:
# Create a background
new BackgroundLayer backgroundColor: "#28affa"
# Create layers
layerC = new Layer
backgroundColor: "#fff"
width: 300
height: 100
layerD = new Layer
backgroundColor: "#2889fa"
width: 150
height: 100
layerD.superLayer = layerC
# Position layers
layerC.center()
layerD = layerC.minX
# Click Event
layerD.on Events.Click, ->
layerD.animate
properties:
x: this.x + 50
curve: "ease"
time: 1