Programmatically Triggering MouseDown/Drag Event
Hi..
Does anyone know how one could generate a mousedown or event or start
a "drag" programmatically in order to cause a draggable to start
dragging?
I have a number of overlapping, absolutely positioned divs where
certain sections of the background images are transparent.. What I
need to do is to allow the user to drag the topmost div that is not
transparent at the xy coord of the mouse down event.. What I'd like
to do is to register for the mousedown event, iterate through all
elements that overlap the xy coord, make the first one that isn't
transparent at that point draggable, and fire a mousedown event on
that element, starting the drag..
For example, if you look at the diagram (ascii art) at the bottom of
this message, there are two rectangles with a small rectangle cut out
of the middle of each.. One rectangle filled with "#" chars is above
the other which is filled with "<" chars, but part of the "<" rect is
visible behind the "#" rect.. The user needs to be able to drag the
"<" rect by clicking through the hole in the "#" rect.. I have an in
memory boundary representation of the filled rects, so I can query
this to do the hit testing, but need a mechanism to start the dragging
programmatically.. Generating a "click" event doesn't seem to work as
this seems to fire after releasing the mouse where dragging occurs on
mouse down..
Any thoughts?
Ed
################
################ <<<
####<<<<<<<#### <<<
####<<< #### <<<
####<<< #### <<<
################ <<<
################ <<<
<<<<<<<<<<<<<<