如果我想控制一个简单的动画,我可以将它设置为header
变量,然后这样做header.play()
:
let header= element.animate({
transform: ['scale(1)', 'scale(1.5)']
}, {
duration: 1000,
fill: 'both'
});
header.play();
但是当我将它链接起来以便使用不同的动画一起发生时composite
,这将不起作用,因为它是多个定义:
element.animate({
transform: ['scale(1)', 'scale(1.5)']
}, {
duration: 1000,
fill: 'both'
});
element.animate({
transform: ['rotate(0deg)', 'rotate(180deg)']
}, {
duration: 1500,
fill: 'both',
composite: 'add'
});
我将如何控制这些一起使用play()
, pause()
?