Get the coordinates of a drop event in Javascript?
I made a Javascript library that lets me drag a marker from a dragzone to one or more dropzones.
The problem is... th开发者_Go百科e mouseup event happens over the marker I'm dragging, not the dropzone.
How can I detect in which dropzone was the marker dropped, and in what coordinates?
Here's my script:
http://dl.dropbox.com/u/186012/demos/dragger/drag.html
if having a new instance is the only special thing you need... you can use the jQuery library to clone your initial clicked upon marker, and drag that clone to where you want it to be.
You can also modify the cloned marker's attributes with jQuery depending on your needs.
This is not actually a direct answer to your question, but why reinvent a solution to this problem that has already been solved in the many popular and robust javascript libs like JQuery.
精彩评论