admin管理员组文章数量:1391995
I'm a beginner in anime.js. I animate something and after the animations is plete i want to remove the element that i'm animating.
The animation is working perfect. I just can't remove the element that im working and i dont want to hide it
logoTimeline
.add({
targets: text1,
duration: 700,
delay: function(el, index) { return index*50; },
opacity: 1,
easing: 'easeOutCirc',
translateX: function(el, index) {
return [(-50+index*10),0]
},
offset:0
})
.add({
remove:text1
})
I'm a beginner in anime.js. I animate something and after the animations is plete i want to remove the element that i'm animating.
The animation is working perfect. I just can't remove the element that im working and i dont want to hide it
logoTimeline
.add({
targets: text1,
duration: 700,
delay: function(el, index) { return index*50; },
opacity: 1,
easing: 'easeOutCirc',
translateX: function(el, index) {
return [(-50+index*10),0]
},
offset:0
})
.add({
remove:text1
})
Share
Improve this question
edited Nov 28, 2017 at 20:33
Mart Cube
asked Nov 28, 2017 at 20:20
Mart CubeMart Cube
773 silver badges10 bronze badges
1
- If you want to add up something to the detail of the question then use the edit button below the Question. – Muhammad Omer Aslam Commented Nov 28, 2017 at 20:26
1 Answer
Reset to default 5Per the API Documentation you need to add a plete
callback function which will fire once the animation has pleted:
logoTimeline
.add({
targets: text1,
duration: 700,
delay: function(el, index) { return index*50; },
opacity: 1,
easing: 'easeOutCirc',
translateX: function(el, index) {
return [(-50+index*10),0]
},
offset:0,
plete: function(anim) {
logoTimeline.remove();
}
});
本文标签: javascripthow to remove element in animejsStack Overflow
版权声明:本文标题:javascript - how to remove element in anime.js? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744691246a2620006.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论