|
-
Jun 29th, 2005, 07:32 PM
#1
Thread Starter
Junior Member
simple drag & drop
Im looking for some direction on dragging an object and dropping it on another object via javascript. I have seen a few drag/drop examples but they seem far more complicated then they need to be and I dont want 50K js files with my webpages. I have some basic drag functions that work but Im having trouble with the drop.
Does anyone know of a good way to detect what object Im over when I release the mouse when dragging? A mouseover function doesnt seem to work because it doesnt seem to fire while Im dragging something. An ondrop doesnt work because its IE only. I thought I might be able to loop through every object in the DOM to check the coordinates but Im thinking multiple objects could be at that coordinate so that doesnt really tell me what the target object should be. I would be dragging an image to a div or another image in that div.
Anyone know a good way to do a simple drag/drop thats cross browser compatable or point me in the right direction?
-
Jul 1st, 2005, 03:26 AM
#2
Frenzied Member
Re: simple drag & drop
Take a look at http://www.walterzorn.com/dragdrop/d...p_e.htm#addons - its x-browser compatible and also has an API to make it easier to use.
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Jul 1st, 2005, 06:42 AM
#3
Thread Starter
Junior Member
Re: simple drag & drop
I have looked at http://www.walterzorn.com/dragdrop/dragdrop_e.htm before but as much as it does, it does not actually perform a drop. Infact the code it has for a drop looks like this,
/* THIS ONE IS CALLED ONCE AN ITEM IS DROPPED
See the description of my_PickFunc for what's accessible from here.
Here may be investigated, for example, what's the name (dd.obj.name)
of the dropped item, and where (dd.obj.x, dd.obj.y) it has been dropped... */
function my_DropFunc()
{
}
For some reason, the majority of drap and drop examples are really more like drag and release examples, they do not actually attempt to figure out what the target is so they are not true drag and drop. Im able to do the drag with far less code, its figuring out what item Im dropping on that is the problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|