Skip to content

(Example) Remove something from the DOM with animation #50

@GrosSacASac

Description

@GrosSacASac

One way would be to be able to provide a custom removeNode function

const removeNode = (node) => {
    if (node.nodeType === 1) {
    node.animate([
        // keyframes
        { transform: 'translateY(0px)' },
        { transform: 'translateY(-300px)' }
      ], {
        // timing options
        duration: 20000,
        iterations: 1
      }).finished.then(function () {
          node.remove();
      });
    } else {
        node.remove()
    }
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions