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();
}
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744691246a4588221.html
评论列表(0条)