我不是英语母语人士,对不起我的台词。
我做了这样的数组..
# item layers
a = new Layer({x:20, width:80, height:80, image:"images/a.png"})
b = new Layer({x:120, width:80, height:80, image:"images/b.png"})
c = new Layer({x:220, width:80, height:80, image:"images/c.png"})
d = new Layer({x:320, width:80, height:80, image:"images/d.png"})
e = new Layer({x:420, width:80, height:80, image:"images/e.png"})
f = new Layer({x:520, width:80, height:80, image:"images/f.png"})
# item layers array - draggable
item = [a, b, c, d, e, f]
for i in [0..5]
item[i].draggable.enabled = true
item[i].draggable.speedY = 0
item[i].borderRadius = 100
item[i].opacity = 0.5
item[i].centerY()
# item reorder
item[i].on Events.DragMove, ->
if item[i].midX > item[i+1].midX
item[i+1].animate
properties:
x:item[i+1].x - 100
else if item[i].midX < item[i-1].midX
item[i-1].animate
properties:
x:item[i-1].x + 100
但它不起作用。拖动图层a时,其他图层不移动。我该如何解决?