【发布时间】:2015-06-25 11:12:12
【问题描述】:
我正在尝试按顺序对几个 SVG 线条元素进行动画处理,我在这里遵循@Gaby 方法A non-nested animation sequence in jQuery? 并使用了 jQuery 队列。但是我的 WebkitAnimationEnd 永远不会被解雇。也许它不适用于 SVG 元素,但文档中没有提到:
var q = $({});
function pushQueue(theQueue, selector, animationprops) {
theQueue.queue(function(next) {
$('#' + selector).one("webkitAnimationEnd oanimationend msAnimationEnd animationend", function(){
console.log('Animation ended, calling next..');
next();
} );
s.select('#' + selector)
.clone()
.addClass('path')
.attr({
stroke: "#FFE840",
filter: 'none'
});
});
}
我在下面添加了一个CodePen,你可以点击p103管道正下方的阀门看看效果。
【问题讨论】:
-
不应该是“on”而不是“one”吗?
-
@Ian nop 这是一个api.jquery.com/one,也试了以防万一
标签: javascript svg snap.svg svg-animate