The purpose of the “Drag” function is to allow a viewer of your web page to move things around as they would on the “Desktop” of their computer. Drag is accomplished by creating  an action for the element to be dragged along the following recipe:

When -> Mouse -> Mouse Down
Target -> (Element to be Dragged)
Message -> Drag -> Start Drag
Parameter(s) -> Until Mouse Up

plainbutton

The example at right uses the Action above to set up dragging. You´ll notice that can drag that “Drag Me!” element all over the darn place - in fact, you can drag it off the layout area of the page entirely!

To keep that from happening, you can use the “Constrain” Action.

One of the main features of using “CSS and Layers” is the ability to make elements on the page draggable (at least, that´s the first thing I did with it!). This section will discuss the dynamics of “Drag”, as well as “Constraining” Drag and the elusive-but-very-powerful “Collision Detection” feature in DHTML Actions.

Contents:

  • Drag - What it does
  • Constraining Drag - How to keep things from getting out of hand
  • Collision Detection - How to make things happen when you move things on top of other things (aka “The most ungainly subtitle I have ever written”)

Drag - What it Does

Have a question that you can´t find the answer to? Want to report a possible bug?

Send a help request to NetObjects Technical Support

Actions  -  Drag Overview

Note:  All Actions described in this section have been tested with Fusion 3.x, 4.x, 5.x and MX.
           Actions will not currently work properly when viewed with Netscape 6.0