







|
Imagemap
The imagemaps discussed here are NCSA imagemaps.
When the Web first became popular, one of the cool things that caught
people's attentiion is the use of imagemaps. Imagemap is basically an
image. Depending on where you click on the image, you will go to the
link that is associated with that section of the image. For example,
if you click on the 'Guest Book' part of our header image, you will
go to the Guest Book page.
So how to create an imagemap? It's really very easy. Here are the
basic steps:
- First of all, you will need to create an image.
- Now you will have to create an imagemap map file. To do this,
you can either create the file using a text editor like notepad or
vi, or you can using an imagemap editor like
Mapedit. Either way,
the final map file should look something like:
default http://internextra/index.htm
rect http://internextra/gb.shtml 515,1 597,14
rect http://internextra/help.htm 522,15 596,28
rect http://internextra/news.htm 512,29 596,42
where
default... is the default URL when clicking on an
area that's not mapped.
rect is for rectangle
http://... is the URL that the rectangle points to
515,1 597,14 are the rectangular coordinates in x,y x,y
- Finally you have to modify your HTML to tell it that you are
using an imagemap. The following is an example:
<A HREF="http://www.xyz.edu/cgi-bin/imagemap/~newbie/test.map">
<IMG SRC="/~newbie/gifs/test.gif" ISMAP>
</A>
where
The first line indicates the location of your map file.
The second line is a regular <img> tag with ISMAP indicating
an imagemap.
Hopefully that's enough instruction for you to create an imagemap.
For a more detailed discussion on imagemap, take a look at
NCSA's Imagemap Tutorial.
|