• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 13. Add Advanced Behaviors: Drag La... > Constrain the Movement of Your Layer

Constrain the Movement of Your Layer

You've created your drag and target layers and given them all names and you are now ready to apply the Drag Layer behavior. To apply the Drag Layer behavior to the <body> tag:

  1. Select the <body> tag from the tag selector in the Dreamweaver status bar.

  2. Click the + button in the Behavior inspector and select Drag Layer. The Drag Layer dialog box appears as shown in Figure 13.2.

    Figure 13.2. The Drag Layer dialog box has a basic and an advanced section.

  3. Select the name of one of the layers to be dragged from the Layer pop-up menu.

  4. Select Constrained from the Movement pop-up menu. Four boxes appear for you to enter the pixel value of coordinates of an area. To constrain movement to only vertical, enter values for up and down but enter 0 for right and left. To constrain movement to only horizontal, enter values for left and right but enter 0 for up and down. To define a rectangular area, enter values in all of the boxes. Values are all relative to the original position of the layer. The Drag Layer dialog box should look like Figure 13.3.

    Figure 13.3. When you select Constrained from the Movement pop-up menu four new boxes appear. Enter pixel values to define the constrained movement area.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint