Example of parameter passing to the first drag and drop object instance of an array of objects:
<a href = "#" onmouseover = "dd_obj[0].show (1, '<p>My Caption</p>', '<div>Content of Window</div>', 300); return false;" onmouseout = "dd_obj[0].release (); return false;" onclick = "return false;">
Place mouse cursor over link to activate tooltip, move mouse outside link to release
</a>
The following parameters may be passed to objects by the above means:
| NORESET | object specific flag to enable/disable object trigger reset (true or false) |
| IGNORE_SHOWHIDE | next function call to object's show() or hide() functions will exit immediately if set, flag is then cleared so that the functions can execute the next time either is called |
| OFFX | tooltip X offset from cursor |
| OFFY | tooltip Y offset from cursor |
| DRAGALL | enable or disable full or partial drag region (true or false) |
| DRAG | enable or disable draggable object property (true or false) |
| DRAG_DELAY | default value of false ends the auto-hide delay of this object if a drag operation is initiated; true = resume delay of object following the end of a drag operation |
| CONTROL | enable or disable the control panel object, which contains the close button and/or other elements (true or false) |
| CURSOR | specifies a cursor name for the drag icon (default: "move") |
| LIMIT_T | limit top edge (-1 = top window edge, 0 = no limit, positive whole number = custom edge) |
| LIMIT_L | limit left edge (-1 = left window edge, 0 = no limit, positive whole number = custom edge) |
| LIMIT_R | limit right edge (-1 = right window edge, 0 = no limit, positive whole number = custom edge) |
| LIMIT_B | limit bottom edge (-1 = bottom window edge, 0 = no limit, positive whole number = custom edge) |
| AUTOX | auto adjust horizontal offset of tooltip to opposite edge if boundary is touched (0 = no limit, 1 = auto limit, -1 = force edge) |
| AUTOY | auto adjust vertical offset of tooltip to opposite edge if boundary is touched (0 = no limit, 1 = auto limit, -1 = force edge) |
| X | initial left-most position of the object on the Web page document (-1 = dynamic based on cursor and offset) |
| Y | initial top-most position of the object on the Web page document (-1 = dynamic based on cursor and offset) |
| W | fixed width of the object |
| ANCHOR | web page element ID string |
| ANCHOR_W | anchor to object width (true or false) |
| ANCHOR_H | anchor to object height (true or false) |
| REWRITE | rewrite object skin layout, caption and content (true or false), default: true (rewrite always), static object content, objects not shared: use 0 to avoid rewriting static object content |
| SKIN | skin index value indicating which skin is used for the object |
| FLASHOBJ | indication that an object contains embedded Flash content |
| OPACITY_ON | opacity of the object on focus (percentage value 0-100) |
| OPACITY_OFF | opacity of the object off focus (percentage value 0-100) |
| OPACITY_IN | initial opacity of the object (percentage value 0-100) |
| OPACITY_STEP | gradual opacity adjustment during the fade transition |
| FADERESET | reset object fading when focus is lost (true or false) |
| RESET_PARAMS | reset all object parameters to the defaults (1, 2), where a value of 2 will not reset the value contained in the object's noreset property |
| PARENT | specify parent object index of this object (the child), a value of -1 indicates no parent by default |
| PLOC | indicates whether or not the child node object should snap to the parent node object location before taking into account this object's specified offset (true = snap, false = default no snap) |
| PW | X offset child node location to parent width (parent index equals 0+ and ploc must be set) |
| PH | Y offset child node location to parent height (parent index equals 0+ and ploc must be set) |
The following object methods set or get attributes specific to a ddobj object instance:
| show(...) | display the drag and drop object with a chosen skin at the mouse cursor or pre-defined position |
| hide(...) | hide the drag and drop object - if the object is already in control, avoid interruptions/ignore hiding the object unless object hide is forced by the force parameter (true or false) |
| params(...) | pass any number of parameters to the drag and drop object |
| release() | signals that an object is not to be locked onto the motion of the mouse any longer - this is the case with the drag-and-drop objects in the example where the onmouseout or onclick events of the link will detach the objects from mouse tracking until they are put in motion by a drag operation |
| resetHide() | reset automatic object hide delay so that an object disappears after the delay specified in variable dd_pkg.delay_hide has been reached - the delay of the popups can be assigned by setting the value of constant variable dd_pkg.delay_hide = #; where the value of # is in tenths of a second (E.g. 200 would equal a delay of 2 seconds) |
| setW() | set the pixel width of the object (on demand) |
| getX() | return the y coordinate of the object at its absolute pixel location on the screen |
| getY() | return the x coordinate of the object at its absolute pixel location on the screen |
| getW() | return the width of the entire object in pixels |
| getH() | return the height of the entire object in pixels |
| getVis() | return the current visibility of the object, which equates to either constant set_hide or set_show |
| vis(flag, force) | sets the visibility of an object according to flag, which may equate to either constant set_show or set_hide - the boolean force parameter is optional, and may be either true or false - a value of true will force the visibility regardless of any condition that would otherwise terminate the visibility from being set prematurely |
| setControls(...) | send custom content markup to control panel object defining what icons and functions should appear |
The following callback prototype functions can be declared for extending ddobj functionality. These extended object methods enable custom application development of any type of drag and drop interface on your Web page:
| cbhide() | drag and drop object prototype method (on object close/hide) |
| cbdown() | drag and drop object prototype method (on button down object drag activation) |
| cbup() | drag and drop interface prototype method (on button up object drag de-activation) |
| cbmove() | drag and drop interface prototype method (on move object drag) |