D
Daniel Kraft
Hi,
I'm trying to implement this: I've got a some absolutely positioned
elements in a webpage and want to allow the user to move another element
per Drag & Drop between those. Thus I want to catch mousemove events
and position the object being moved centered at the cursor; and when the
user fires mouseup on one of the target objects, the moved object should
be dropped there.
My problem however is, that I want to position the moved object on top;
but then only this object receives the mouseup and not the target object
below it. Is there a way to work around this or to solve my problem
some other way?
I thought about the possibility to disable event handling on the moved
object entirely (say something like "event masks" to disable catching
mouseup events on it) so that the event would be fired on the element
below it, but there seems to be no such possibility with DOM Events (at
least Level 2 I've looked at).
Another thing I tried was catching the event and re-firing it; but as I
don't know which target object the mouse was above on the screen, I
could only fire it on the overall-container object and it seemed not to
be propagated to the right child...
Any suggestions would be very welcome! In theory, I could calculate
which target object to fire the event on; this however is something I
would like to avoid and let the browser do for me just as it would if I
could prevent the event from firing on the moved object on top.
Thanks,
Daniel
I'm trying to implement this: I've got a some absolutely positioned
elements in a webpage and want to allow the user to move another element
per Drag & Drop between those. Thus I want to catch mousemove events
and position the object being moved centered at the cursor; and when the
user fires mouseup on one of the target objects, the moved object should
be dropped there.
My problem however is, that I want to position the moved object on top;
but then only this object receives the mouseup and not the target object
below it. Is there a way to work around this or to solve my problem
some other way?
I thought about the possibility to disable event handling on the moved
object entirely (say something like "event masks" to disable catching
mouseup events on it) so that the event would be fired on the element
below it, but there seems to be no such possibility with DOM Events (at
least Level 2 I've looked at).
Another thing I tried was catching the event and re-firing it; but as I
don't know which target object the mouse was above on the screen, I
could only fire it on the overall-container object and it seemed not to
be propagated to the right child...
Any suggestions would be very welcome! In theory, I could calculate
which target object to fire the event on; this however is something I
would like to avoid and let the browser do for me just as it would if I
could prevent the event from firing on the moved object on top.
Thanks,
Daniel