0
我試圖在點擊時在Framer.js中創建一個子圖層。我得到的是「Uncaught TypeError:layerD.on不是函數」。如何在Framer.js中單擊動畫子圖層?
我是否在做錯誤或動畫子圖層在Framer中不可行?
下面的代碼:
# 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