question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Request] Functionality to duplicate DOM node

See original GitHub issue

I’d love a parameter like “duplicateNode: true” That would make it so the dom node is duplicated on the spot and the animation is only done on the duplication.

Great to make items fly into a cart but keep the original dom item in place!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
everdimensioncommented, Jun 26, 2018

@mesqueeb You can do it yourself though, can’t you? I’m currently doing this as well where I need to

Something like

anime({
  targets: targets.map(n => n.cloneNode(true)),
  /* other options */
});
0reactions
juliangarniercommented, Jan 9, 2019

This is more JS related than anime.js related, and way too specific to be added in to the doc. Thanks @everdimension for the solution !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.cloneNode() - Web APIs - MDN Web Docs
To clone a node to insert into a different document, use Document.importNode() instead. Syntax. cloneNode() cloneNode(deep)
Read more >
HTML DOM Element cloneNode Method - W3Schools
Definition and Usage. The cloneNode() method creates a copy of a node, and returns the clone. The cloneNode() method clones all attributes and...
Read more >
How to copy a DOM node with event listeners? - Stack Overflow
Use a wrapper function around Node.addEventListener() to keep track of listeners added to each node. This is how jQuery's clone() method is able ......
Read more >
CloneNode() method in JavaScript? - Tutorialspoint
Example 1 · First, use the querySelector() function to choose the ul with the id menu. · Second, use the cloneNode() method to...
Read more >
How to copy or clone an element with vanilla JS
You call the cloneNode() method on the element you want to copy. If you want to also copy elements nested inside it, pass...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found