|
Image maps allow users to access other documents by clicking different
areas in an image. You can implement image maps in two ways: by storing
image map information on a server or by including image map information
in your document.
If you store
image map information on a server, you need a script or other service on
the server to process click information. In your document, you mark the
image as a "server-side" image map by using the ISMAP attribute in the
IMG element and enclosing the image in an A element, as in the following
example:
<A HREF="Jump.map"><IMG
SRC="Sample.gif" ISMAP></A>
In this example,
the image map information is in the file named Jump.map. When the user
clicks the picture in Sample.gif, the server receives the coordinates of
the click and can pick the appropriate destination for the click by checking
the information in Jump.map.
If you include
image map information in your document, Internet Explorer processes the
click information and picks the appropriate destination for the click.
In your document, you mark the image as a "client-side" image map by using
the USEMAP= attribute in the IMG element, and you add image map information
by using the MAP and AREA elements, as in the following example:
<MAP NAME="map1">
<AREA SHAPE="RECT"
COORDS="0, 0, 16, 16" HREF="Sample1.htm">
<AREA SHAPE="RECT"
COORDS="0, 16, 16, 16" HREF="Sample2.htm">
</MAP>
<IMG BORDER=0
SRC="map1.gif" USEMAP="#map1">
In this example,
the image map defines two equal rectangular areas. The area on the left
is linked to Sample1.htm. The area on the right is linked to Sample2.htm.
The AREA element
permits other shapes, such as circles and polygons. If two or more shapes
overlap, Internet Explorer uses the first shape defined in the MAP element
to determine the destination. Any number of AREA elements can specify the
same destination. This is useful if you want to map a complex shape to
a single destination. If a portion of the image is not within a given shape,
clicking in that portion has no effect. |
|