Velocity.js最新更新(2.0.3)后无法读取属性“模式"错误 [英] Cannot read property 'pattern' error after velocity.js latest update (2.0.3)

查看:117
本文介绍了Velocity.js最新更新(2.0.3)后无法读取属性“模式"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码一直工作到昨天:

My code worked until yesterday:

<script src="//cdn.jsdelivr.net/npm/velocity-animate@2.0/velocity.min.js"></script>

$('[id^=home-layer-]').velocity({
    transform: 'scale(2)'
}, {
    duration: duration,
    easing: "ease-out",
    loop: false
});

现在我遇到了错误:

未捕获到的TypeError:无法读取ut(velocity.min.js:632)上未定义的属性模式"

Uncaught TypeError: Cannot read property 'pattern' of undefined at ut (velocity.min.js:632)

推荐答案

在为报告了以0px开头的值的属性设置动画时,该错误与新的Sequences代码一起出现-应该对此进行处理与0相同,并非如此.

It was a bug that slipped in with the new Sequences code when animating a property that reported a 0px value to start with - which should have been treated the same as 0 and wasn't.

当前固定在master上,将在2.0.5版中

Currently fixed on master, and will be in 2.0.5

这篇关于Velocity.js最新更新(2.0.3)后无法读取属性“模式"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆