
Screen.backgroundColor="#7ddd11"
page=new PageComponent
x: Align.center
y: Align.center
width: 300
height: 300
borderRadius: 10
scrollVertical : false
page.contentInset=
lefe:20
right:20
for i in [0..4]
layer=new Layer
parent:page.content
name:"page #{i}"
x:210*i
y:50
backgroundColor:"#fff"
borderRadius:6
opacity:0.3
page.snapToNextPage()#允許兩頁進(jìn)行滑動(dòng)
page.currentPage.opacity=1
page.onChange "currentPage",->#當(dāng)前頁會(huì)變成前一頁
page.previousPage.animate#當(dāng)前頁變成前一頁的動(dòng)畫
properties:
opacity:0.3
scale:0.1
time:0.4
page.currentPage.animate#前一頁變成當(dāng)前頁動(dòng)畫
properties:
opacity:1
scale:1
time:0.4