Class YAHOO.util.DD
Extends
YAHOO.util.DragDrop.
Defined in: dragdrop.js.
Constructor Attributes | Constructor Name and Description |
---|---|
YAHOO.util.DD(id, sGroup, config)
A DragDrop implementation where the linked element follows the
mouse cursor during a drag.
|
Field Attributes | Field Name and Description |
---|---|
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.
|
- Fields borrowed from class YAHOO.util.DragDrop:
- __ygDragDrop, _domRef, available, config, constrainX, constrainY, dragElId, groups, handleElId, id, invalidHandleClasses, invalidHandleIds, invalidHandleTypes, isTarget, locked, maintainOffset, maxX, maxY, minX, minY, padding, primaryButtonOnly, startPageX, startPageY, xTicks, yTicks
Method Attributes | Method Name and Description |
---|---|
alignElWithMouse(el, iPageX, 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.
|
|
autoOffset(iPageX, iPageY)
Sets the pointer offset to the distance between the linked element's top
left corner and the location the element was clicked
|
|
<private> |
autoScroll(x, y, h, w)
Auto-scroll the window if the dragged object has been moved beyond the
visible window boundary.
|
b4Drag(e)
Event that fires prior to the onDrag event.
|
|
b4MouseDown(e)
Event that fires prior to the onMouseDown event.
|
|
cachePosition(iPageX, iPageY)
Saves the most recent position so that we can reset the constraints and
tick marks on-demand.
|
|
<private> |
getTargetCoord(iPageX, iPageY)
Finds the location the element should be placed if we want to move
it to where the mouse location less the click offset would place us.
|
setDelta(iDeltaX, iDeltaY)
Sets the pointer offset.
|
|
setDragElPos(iPageX, 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.
|
- Methods borrowed from class YAHOO.util.DragDrop:
- addInvalidHandleClass, addInvalidHandleId, addInvalidHandleType, addToGroup, applyConfig, b4DragDrop, b4DragOut, b4DragOver, b4EndDrag, b4StartDrag, clearConstraints, clearTicks, endDrag, getDragEl, getEl, getTick, handleMouseDown, handleOnAvailable, init, initTarget, isLocked, isValidHandleChild, lock, onAvailable, onDrag, onDragDrop, onDragEnter, onDragOut, onDragOver, onMouseDown, onMouseUp, removeFromGroup, removeInvalidHandleClass, removeInvalidHandleId, removeInvalidHandleType, resetConstraints, setDragElId, setHandleElId, setInitPosition, setOuterHandleElId, setPadding, setStartPosition, setXConstraint, setXTicks, setYConstraint, setYTicks, startDrag, toString, unlock, unreg
Class Detail
YAHOO.util.DD(id, sGroup, config)
A DragDrop implementation where the linked element follows the
mouse cursor during a drag.
- Parameters:
- {String} id
- the id of the linked element
- {String} sGroup
- the group of related DragDrop items
- {object} config
- an object containing configurable attributes Valid properties for DD: scroll
Field Detail
{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.
Method Detail
alignElWithMouse(el, iPageX, 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:
- {HTMLElement} el
- the element to move
- {int} iPageX
- the X coordinate of the mousedown or drag event
- {int} iPageY
- the Y coordinate of the mousedown or drag event
autoOffset(iPageX, iPageY)
Sets the pointer offset to the distance between the linked element's top
left corner and the location the element was clicked
- Parameters:
- {int} iPageX
- the X coordinate of the click
- {int} iPageY
- the Y coordinate of the click
<private>
autoScroll(x, y, h, w)
Auto-scroll the window if the dragged object has been moved beyond the
visible window boundary.
- Parameters:
- {int} x
- the drag element's x position
- {int} y
- the drag element's y position
- {int} h
- the height of the drag element
- {int} w
- the width of the drag element
b4Drag(e)
Event that fires prior to the onDrag event. Overrides
YAHOO.util.DragDrop.
- Parameters:
- e
b4MouseDown(e)
Event that fires prior to the onMouseDown event. Overrides
YAHOO.util.DragDrop.
- Parameters:
- e
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.
- Parameters:
- iPageX
- iPageY
<private>
getTargetCoord(iPageX, iPageY)
Finds the location the element should be placed if we want to move
it to where the mouse location less the click offset would place us.
- Parameters:
- {int} iPageX
- the X coordinate of the click
- {int} iPageY
- the Y coordinate of the click
- Returns:
- an object that contains the coordinates (Object.x and Object.y)
setDelta(iDeltaX, 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 YAHOO.widget.Slider)
- Parameters:
- {int} iDeltaX
- the distance from the left
- {int} iDeltaY
- the distance from the top
setDragElPos(iPageX, 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:
- {int} iPageX
- the X coordinate of the mousedown or drag event
- {int} iPageY
- the Y coordinate of the mousedown or drag event