我可以像这样更改 left 的值:
$.Velocity.animate(element,
{ left: '100%' }, 0
);
但是我怎样才能用一个变量来动态地改变这个属性,就像这样。
var side = 'left';
$.Velocity.animate(element,
properties[side] = '100%', 0
);
然后我可以动态地将一侧设置为向右或向左。
我可以像这样更改 left 的值:
$.Velocity.animate(element,
{ left: '100%' }, 0
);
但是我怎样才能用一个变量来动态地改变这个属性,就像这样。
var side = 'left';
$.Velocity.animate(element,
properties[side] = '100%', 0
);
然后我可以动态地将一侧设置为向右或向左。