Question on the dragDrop method

D

Don Li

I've 'minicked' a small function with the dragDrop method, it's
working. What I'd like to go a step further would be doing copy the
object to another location on the same page instead of moving it.

A piece of advice is to clone the original one before applying the
dragDrop, then question, what's wrong with the following?

// create a new element
var newElement = document.createElement('copy1');

// set its value;
// background info: the page has an ID of "test1", source elment
copy1 = test1.cloneNode(true);

// where to insert it;
test1.appendChild(newElement);

Also, even if the above code works, it's not good enough because the
cloned element needs to overlay the top of the original source, how?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,863
Latest member
montyonthebonty

Latest Threads

Top