【发布时间】:2018-07-31 07:13:43
【问题描述】:
我有一个代码会逐个淡化。代码从演示中进行了一些修改。演示在这里:http://thenewcode.com/1178/Create-a-Word-Fade-In-Effect-Using-the-Web-Animation-API
代码:
function fadeWords(thequote) {
time=0;
first = true;
Array.prototype.forEach.call(thequote, function(word,i) {
timspan= i * 150;
let animate = word.animate([{
opacity: 0,
filter: "blur("+getRandom(2,5)+"px)"
}, {
opacity: 1,
filter: "blur(0px)"
}],
{
duration: 600,
delay: timspan,
fill: 'forwards'
}
)
})
}
Safari 给我错误:未定义不是函数('...word.animate...' 附近)
如果我取消我所做的修改,该演示仍然无法在 Safari 中运行。
【问题讨论】: