Show-Hide Layers
The Show-Hide Layers action shows, hides, or restores the default visibility
of one or more layers. This action is useful for showing information as the
user interacts with the page. For example, as the user rolls the mouse pointer
over an image of a plant, you could show a layer that gives details about the
plant’s growing season and region, how much sun it needs, how large it
can grow, and so on.
Show-Hide Layers is also useful for creating a preload layer—that is, a large layer that obscures the contents of the page at first and then disappears when all the page components have finished loading.
To use the Show-Hide Layers action:
Choose Insert > Layer or click the Layer button in the Insert bar, and draw
a layer in the Document window.
Repeat this step to create additional layers.
Click in the Document window to deselect the layer, then open the Behavior
panel.
Click the plus (+) button and choose Show-Hide Layers from the Actions pop-up
menu.
If Show-Hide Layers is unavailable, you probably have a layer selected. Because
layers do not accept events in both 4.0 browsers, you must select a different
object—such as the body tag or a link (a tag)—or change the target
browser to IE 4.0 in the Show Events For pop-up menu.
From the Named Layers list, select the layer whose visibility you want to change.
Click Show to show the layer, Hide to hide the layer, or Default to restore
the layer’s default visibility.
Repeat steps 4 and 5 for all remaining layers whose visibility you want to change
at this time. (You can change the visibility of multiple layers with a single
behavior.)
Click OK.
Check that the default event is the one you want.
If it isn’t, choose another event from the pop-up menu. If the events
you want are not listed, change the target browser in the Show Events For pop-up
menu.
When viewed in a Netscape Navigator browser window, layers may shrink to fit the content. To keep this from happening, add text or images to layers, or set layer clip values.
To create a preload layer:
Click the Draw Layer button in the Common category of the Insert bar and draw
a large layer in the Document window’s Design view.
Be sure the layer covers all the content on the page.
In the Layers panel, drag the layer name to the top of the list of layers to
specify that the layer should be at the front of the stacking order.
Select the layer if it’s not selected, and name it loading, using the
leftmost field in the layer Property inspector.
With the layer still selected, set the background color of the layer to the
same color as the page background in the Property inspector.
Click the <body> tag in the tag selector in the bottom left corner of
the Document window.
In the Behaviors panel, choose Show-Hide Layers from the Actions pop-up menu.
Select the layer called loading from the Named Layers list.
Click Hide.
Click OK.
Make sure that the event listed next to the Show-Hide Layers action in the behaviors
list is onLoad. (If it isn’t, select the event and click the downward-pointing
triangle that appears between the event and the action. Choose onLoad from the
list of events in the pop-up menu.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100