Javascript 动画-相对于当前位置移动
我正在尝试相对于动画中的当前位置移动divJavascript 动画-相对于当前位置移动,javascript,animation,css-transitions,Javascript,Animation,Css Transitions,我正在尝试相对于动画中的当前位置移动div var myAnimation = anime({ targets: ['.location'], translateY: "-300px", easing: 'linear', delay: function(el, index) { return index * 80; }, duration: 500, loop: false }); }) 我试过了 translateY: "-=300px", 没有
var myAnimation = anime({
targets: ['.location'],
translateY: "-300px",
easing: 'linear',
delay: function(el, index) {
return index * 80;
},
duration: 500,
loop: false
});
})
我试过了
translateY: "-=300px",
没有成功。有什么想法吗?试着通过js获得你的出发点,并用括号具体说明。 像这样:
property: [startpoint, endpoint]