Step Four: Make the Image Maps
You may have noticed that I keep referring to "creating image maps" in the plural. In addition to the regular map, we'll use Dreamweaver's Image Map Editor to draw the coordinates necessary to perform the clipping function.
The first part of Step Four is to make the actual image map that will eventually be used to activate the onMouseOver and onMouseOut events. Follow these steps to complete this task:
Normally, this is where you would stop when building an image map, but we're going to use Dreamweaver's Image Map Editor a second time to find our clipping coordinates for us.
Tip
When a layer is clipped, it
means that only the specified area -- the clip -- can be seen. Presently,
only rectangular clipping is supported in Dynamic HTML and CSS.
You can only have one image map per image, but luckily, we have two identical images to work with. Follow these steps to build your clipping map:
It's important that these areas not overlap, but be drawn side-by-side.
When Dreamweaver builds code for an image map, it places the first item you define as the last item in the code list and the last item as the first. The rectangular coordinates are placed in a left, top, right, bottom order, as can be seen in this code fragment:
<map name="temp">
<area shape="rect" coords="365,0,506,176" href="#slate">
<area shape="rect" coords="236,0,365,176" href="#nest">
<area shape="rect" coords="93,0,234,176" href="#star">
</map>
Notice that I kept the top (0) and the bottom (176) constant for all three areas. While this is not essential it makes your coding a tad simpler and, if possible, is recommended.
|
Step Three: Attach the Behavior |