我尝试使用 jquery 将动画添加到 div :
$('#footer').animate({ "width" : "13%" },1000);
它可以工作,但在控制台中显示错误,例如:
“无法在“Element”上执行“animate”:不支持部分关键帧。”
当我点击正确的链接时:
但是当我使用像素值时,没有错误:
$('#footer').animate({ "width" : 68 },1000);
有没有使用响应值的解决方案?
最佳答案
问题在于您调用 .animate()
的方式。您已将 jQuery 添加到代码库中,但正在使用 web platform's animate使用您调用 .animate()
的方式。如果你希望它能与 jQuery 一起正常工作,请更改:
var player = this.move_.animate();
至
var player = $(this.move_).animate();
但是如果您想使用 JavaScript 动画而不是 jQuery,那么您可以使用这个
var player = this.move_.animate({transform: [parameters.transformBegin, parameters.transformEnd]});
我不知道您的参数是什么,但我的示例显示您为要设置动画的每个属性添加多个关键帧作为数组
关于jquery - 无法在 'animate' : Partial keyframes are not supported 上执行 'Element',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38376499/