Deprecated: Function set_magic_quotes_runtime() is deprecated in /home4/mfoster/public_html/cb/forums/include/common.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 34
Cross-Browser.com / Passing the DragEvent to another object

Cross-Browser.com

X Library Forums

You are not logged in.

Announcement

New user registration is currently disabled.

#1 March 10, 2010 11:07:17 am

ericj
Member
From: Seattle, Washington
Registered: February 15, 2008
Posts: 58
Website

Passing the DragEvent to another object

Mike:

I have a somewhat complex scenario I wonder if you could help me with.  Suppose:

i have a picture of an Apple and a picture of a Peanut;
these pictures have been xEnableDrag'd
i am using the parameters in xEnableDrag  - xEnableDrag( myElement, myDragStart, myDrag, myDragEnd)

the apple and the peanut images are 100 x 100 pixels;
the apple fills up the 100 x 100 frame;
the peanut has lots of white space because it is small;

i click on the peanut image somewhere in its white space, not directly on the peanut;
the peanut has gotten a DragStart event with (element,x,y,xEvent)

i decide it is not close enough, i want to drag the apple instead
i call the apple's DragStart with the x, y, xEvent that the peanut got: 
  apple.dragStart(appleElement,peanutX,peanutY,peanutXEvent);

Question:  The apple gets its dragstart.  But when I move the mouse nothing happens.  How can I get the apple to drag?

- ej

Offline

 

#2 March 10, 2010 11:10:30 am

ericj
Member
From: Seattle, Washington
Registered: February 15, 2008
Posts: 58
Website

Re: Passing the DragEvent to another object

The question more specifically is, what properties in the peanutXEvent do I need to change so that when I pass peanutXEvent to apple.dragStart the apple will drag

Offline

 

#3 March 10, 2010 11:29:42 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: Passing the DragEvent to another object

Hi Eric. I'm thinking about this.

Offline

 

#4 March 11, 2010 4:07:55 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: Passing the DragEvent to another object

Sorry for my late reply.

My first idea was to enable drag on an element that contains both the apple and peanut elements (and not on apple and peanut). Then in the drag handlers determine which element is to be dragged.

Another idea is to enable drag on both the apple and peanut elements, but let them both have the same drag handler functions, and then in those determine which element is to be dragged.

Not sure if I'm in the ballpark for your application. Hope that helps smile

Offline

 

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load