Client Class wwDragBehavior

This class provides a Drag Behavior to existing DOM elements on a page by attaching to a specific window and a Drag Handle. A Drag Handle is a 'hot spot' that acts as the initiation point to start a drag operation.

Once configure the control specified becomes draggable and can be moved around the page with a mouse.

<div ID=DragPanel" Class="blackborder greybackground" Width="400" DragHandleID="Header"> <div id="Header" runat="server" class="gridheader"> Panel 3 </div> <div id="Content" style="padding:10px;"> This is my content </div> </div>

To make this panel and it's content draggable via script code:

<script type="text/javascript"> // Startup Script on bottom of page var DragPanel_Behavior = new wwDragBehavior("DragPanel","Header"); </script>

Class Members

MemberDescription
Constructor The constructor attaches the window and draghandle for the wwDragBehavior. The window ID identifies the outer window that is to be dragged. The drag handle ID specifies the area that is the drag hot spot that iniates the drag operation.
hide Hides the window associated with the DragBehavior. Used for closable drag windows.
o.wwDragBehavior.hide()
remove Turns off the drag behavior on the assigned window by removing the event handler.
o.wwDragBehavior.remove()
show Makes the window associated with the DragBehavior visible.
o.wwDragBehavior.show()
dragCompleteHandler A handler that is called when the drag operation is complete.
dragHandle A DOM object that serves as the drag handle for the object dragged.
dragOpacity Determines the opacity as a decimal percentage of the window while it's being dragged.
dragStartHandler Handler called when a drag operation is initiated.
window The DOM instance of the element that is being dragged. This is the top level dragged control.
windowObj A wwControl instance of the window dragged.

Requirements

See also:

Class wwDragBehavior

  Last Updated: 6/1/2008 | © West Wind Technologies, 2008