Create a new DragDrop object. The various options are described below:
Defaults to /. This is the url path to the directory containing wz_dragdrop.js. It can be relative or absolute.
$dd->add_dragable( name => 'drag1', width => 120, height => 120, left => 10, top => 60, content => $html_to_display, # or # src => $image_url, class => $css_class, features => $features, );
This function defines the div tag or image tag that will be dragable. The dragable item must have a name. If your dragable object is an image, then it must also have a width and a height.
The name is the HTML id attribute if the dragable object is not an image, otherwise it is the HTML name attribute. It is output in the html tag, and is compulsary for a dragable object.
The width (and height) attribute is compulsory for images. It works just like defining the width in the HTML or stylesheet. You must use an absolute value for the width (e.g. 240px) and not a relative value (33%).
The height (and width) attribute is compulsory for images. It works just like defining the height in the HTML or stylesheet. You must use an absolute value for the height (e.g. 240px) and not a relative value (33%).
Defines how far from the left of edge of the containing object the dragable object will be when the page loads. The containing object is usually the browser window, but could be another html tag, for example a div tag. For those who are stylesheet savvy, this is the left absolute positioning style.
Defines how far from the top of edge of the containing object the dragable object will be when the page loads. The containing object is usually the browser window, but could be another html tag, for example a div tag. For those who are stylesheet savvy, this is the top absolute positioning style.
If content is provided, the module will create a div tag with an id of the name provided, that contains the content. The content can be straight text or html. If both content and src (image) attributes are present, the src will be used.
The source is the url of an image to use. The module generates an IMG tag with a name of the name provided.
If a class is specified the dragable object will be created with the class given, otherwise it will have a class of "dragable". This is for use with stylesheets, and is especially handy when using the content attribute.
feature applies to description -------- ----------- ------------ CLONE images Makes a single, dragable clone COPY images Makes x dragable copies, e.g. COPY+5 CURSOR_DEFAULT all Default cursor onmouseover CURSOR_CROSSHAIR all Crosshair cursor onmouseover CURSOR_HAND all Hand cursor onmouseover CURSOR_MOVE all Move cursor onmouseover CURSOR_E_RESIZE all East resize cursor onmouseover CURSOR_NE_RESIZE all NorthEast resize cursor onmouseover CURSOR_NW_RESIZE all NorthWest resize cursor onmouseover CURSOR_N_RESIZE all North resize cursor onmouseover CURSOR_SE_RESIZE all SouthEast resize cursor onmouseover CURSOR_SW_RESIZE all SouthWest resize cursor onmouseover CURSOR_W_RESIZE all West resize cursor onmouseover CURSOR_TEXT all Text cursor onmouseover CURSOR_WAIT all Wait cursor onmouseover CURSOR_HELP all Help cursor onmouseover DETACH_CHILDREN layers Dragable objects inside the div don't move with it HORIZONTAL all Only move on the horizontal axis MAXWIDTH all Maximum width to resize to MAXHEIGHT all Maximum height to resize to MINWIDTH all Minimum width to resize to MINHEIGHT all Minimum height to resize to MAXOFFBOTTOM all Maximum downwards movement MAXOFFLEFT all Maximum left movement MAXOFFRIGHT all Maximum right movement MAXOFFTOP all Maximum upwards movement NO_ALT images De-activates the ALT and TITLE attributes NO_DRAG all Object is not dragable RESET_Z all Restores the object's z-index once dropped RESIZABLE all Object can be resized SCALABLE all Object maintains width/height ratio when resized SCROLL all Browser window will scroll as objects are dragged to the edge VERTICAL all Only move on the vertical axis
The output_html method returns all the html to generate the dragable objects. The output MUST be printed before the output of the output_script method.
See Walter Zorn's website http://www.walterzorn.com.
And the examples below
This example shows an image that can be dragged around the browser window.
This example shows two div tags. On that can be dragged around the browser window and another than can only be dragged a limited distance in the horizontal plane but cannot be dragged vertically.
Becky Alcorn, <firstname.lastname@example.org> Simon Taylor, <email@example.com> Unisolve Pty Ltd
Copyright (C) 2004 by Unisolve Pty Ltd
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.