Class YAHOO.util.DD

Object
   |
   +--YAHOO.util.DragDrop
         |
         +--YAHOO.util.DD
Direct Known Subclasses:
YAHOO.util.DDProxy

class YAHOO.util.DD

Field Summary [top]

boolean scroll
When set to true, the utility automatically tries to scroll the browser window wehn a drag and drop element is dragged near the viewport boundary. 

Constructor Summary [top]

YAHOO.util.DD
A DragDrop implementation where the linked element follows the mouse cursor during a drag. 

Method Summary [top]

void alignElWithMouse (<HTMLElement> el, <int> iPageX, <int> iPageY)
Sets the element to the location of the mousedown or click event, maintaining the cursor location relative to the location on the element that was clicked. 
void autoOffset (<int> iPageX, <int> iPageY)
Sets the pointer offset to the distance between the linked element's top left corner and the location the element was clicked 
void b4Drag (e)
Event that fires prior to the onDrag event. 
void b4MouseDown (e)
Event that fires prior to the onMouseDown event. 
void cachePosition (iPageX, iPageY)
Saves the most recent position so that we can reset the constraints and tick marks on-demand. 
void setDelta (<int> iDeltaX, <int> iDeltaY)
Sets the pointer offset. 
void setDragElPos (<int> iPageX, <int> iPageY)
Sets the drag element to the location of the mousedown or click event, maintaining the cursor location relative to the location on the element that was clicked. 

Field Detail [top]

scroll

boolean   scroll
When set to true, the utility automatically tries to scroll the browser window wehn a drag and drop element is dragged near the viewport boundary. Defaults to true.

Constructor Detail [top]

YAHOO.util.DD

YAHOO.util.DD ()
A DragDrop implementation where the linked element follows the mouse cursor during a drag.
Parameters:
id - the id of the linked element
sGroup - the group of related DragDrop items

Method Detail [top]

alignElWithMouse

void alignElWithMouse (<HTMLElement> el, <int> iPageX, <int> iPageY)
Sets the element to the location of the mousedown or click event, maintaining the cursor location relative to the location on the element that was clicked. Override this if you want to place the element in a location other than where the cursor is.
Parameters:
el - the element to move
iPageX - the X coordinate of the mousedown or drag event
iPageY - the Y coordinate of the mousedown or drag event

autoOffset

void autoOffset (<int> iPageX, <int> iPageY)
Sets the pointer offset to the distance between the linked element's top left corner and the location the element was clicked
Parameters:
iPageX - the X coordinate of the click
iPageY - the Y coordinate of the click

b4Drag

void b4Drag (e)
Event that fires prior to the onDrag event. Overrides YAHOO.util.DragDrop.

b4MouseDown

void b4MouseDown (e)
Event that fires prior to the onMouseDown event. Overrides YAHOO.util.DragDrop.

cachePosition

void cachePosition (iPageX, iPageY)
Saves the most recent position so that we can reset the constraints and tick marks on-demand. We need to know this so that we can calculate the number of pixels the element is offset from its original position.

setDelta

void setDelta (<int> iDeltaX, <int> iDeltaY)
Sets the pointer offset. You can call this directly to force the offset to be in a particular location (e.g., pass in 0,0 to set it to the center of the object, as done in ygDDSliderBG)
Parameters:
iDeltaX - the distance from the left
iDeltaY - the distance from the top

setDragElPos

void setDragElPos (<int> iPageX, <int> iPageY)
Sets the drag element to the location of the mousedown or click event, maintaining the cursor location relative to the location on the element that was clicked. Override this if you want to place the element in a location other than where the cursor is.
Parameters:
iPageX - the X coordinate of the mousedown or drag event
iPageY - the Y coordinate of the mousedown or drag event