javascript - how to remove element in anime.js? - Stack Overflow

I'm a beginner in anime.js. I animate something and after the animations is plete i want to remove

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
Add a ment  | 

1 Answer 1

Reset to default 5

Per 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

相关推荐

  • javascript - how to remove element in anime.js? - Stack Overflow

    I'm a beginner in anime.js. I animate something and after the animations is plete i want to remove

    1天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信