我试着使用Noty的网站上的这个例子:http://ned.im/noty/animations.bouncejs.html
我已经安装了noty.js和它的CSS对应部分。我还下载了velocity.js,并在我的网站上有适当的链接。我知道它是正确链接的,因为我可以使用JQuery选择一个元素,并在它上执行由velocity提供的功能:
$("table").velocity("fadeOut", {
duration: 3500
});不过,noty站点上提供的示例使用的调用格式如下:
new Noty({
text: 'NOTY - animating with velocity!',
animation: {
open: function () {
var n = this;
Velocity(n.barDom, {
left: 450,
scaleY: 2
}, {
duration: 0
});
Velocity(n.barDom, {
left: 0,
scaleY: 1
}, {
easing: [ 8, 8 ]
});
},它使用Velocity(... )来调用它当我将这段代码放入我的页面时,它会出错,并且使用chrome F12时,它会显示它是未定义的。我在这个例子中遗漏了什么?弹跳的例子是有效的,但我不太喜欢它的动作。
发布于 2017-05-13 03:01:26
在开发人员的帮助下,我们发现了他网站上的声明有问题。速度并不像问题中所说的那样工作。它需要用当前版本的NOTY & Velocity用$.Velocity声明
new Noty({
text: 'NOTY - animating with velocity!',
animation: {
open: function () {
var n = this;
$.Velocity(n.barDom, {
left: 450,
scaleY: 2
}, {
duration: 0
});
$.Velocity(n.barDom, {
left: 0,
scaleY: 1
}, {
easing: [ 8, 8 ]
});
},https://stackoverflow.com/questions/43417737
复制相似问题