Send image to trash

V

Vincent van Beveren

1. You should read / know the x and y positions of the trash-bin, and if
its on the right location you can remove the element with DOM. Now I
don't know that API you're using, but it doesn't seem to support events
for seeing when an element has been moved.

2. Removing an element with DOM requires you to know the name or ID of
the element, or have a reference to the actual element. See
document.getElementById and document.getElementsByName

for example:

element = document.getElementsByName('Blah')[0];
element = document.getElementById('Blah');

3. Remove it from the model, for example:

element.parentNode.removeChild(element);

MSDN and Mozilla Developer have good references for DOM, you should
check them out.

Vincent
 

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,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top