An Image Map Rollover Menu System
Introduction.
Now that you have seen how to develop
we will develop these notions further in our quest for viable look ahead web browsing. We are going to combine these approaches to create sub menus that popup when the user rolls over a particular image map. Then these submenus will have active links. At present we will maintain our basic table layout. Modifying the overall layout of the menus and submenus is something that will be left to homework. In general, I am trying to develop some ways to get functional popup menus that are fairly easy to implement and work in both Netscape and IE. The usual solutions are VERY complicated. Unfortunately, this particular approach only works in Netscape 6 or later and IE 4 or later. But I still think it is well worth the work. Our next approach will have more universal application. The first thing you need to do is copy the following four images into an images directory. Again, these have been developed as gif files using transparent backgrounds. BlankLinks really is an image that needs to be copied. |
Name | Image |
NewsHumor.gif | |
BlankLinks.gif | |
HumorLinks.gif | |
NewsLinks.gif |
We are going to develop this in two stages, hopefully
this will make the pages clearer. You need to copy the following code into a file called SimpleMenuImageMaps.html. |
<html> <head> <title>Menu Image Maps</title> </head> <body bgcolor="#ddddff" text="#000054" link="#6666FF" vlink="#6666FF"> <p align="left"> </p> <div align="left"> <table border="0" cellpadding="4" cellspacing="0" width="305"> <tr> <td width="117" align="left"> <map name="NHImageMap">
</map> <img border="0" src="images/NewsHumor.gif" usemap="#NHImageMap" width="200" height="250"> </td> <img border="0" src="images/BlankLinks.gif" name="menus"> </td> |
The image should look like the following on the web after you have moused over the News text. |
Now we want to further develop the popup menus so that they are actively linked to their particular sources. We need to have image maps that are invoked when the images appear. This requires some fairly complicated image maps to be written in HTML or developed in some other program like FrontPage or an Adobe product. If you name the image maps then they can be invoked when the appropriate image appears. The following code should be copied into a file called RolloverMenuIMaps.html. |
<html> <head> <title>Menu Image Maps</title> <map name="HumorLinksIMap"> <area href="http://www.collegehumor.com/" shape="rect" coords="15, 40, 170, 67"> <area href="http://www.comedycentral.com/" shape="rect" coords="15, 106, 178, 131"> <area href="http://www.montypython.net/" shape="rect" coords="15, 173, 160, 198"></map> <map name="NewsLinksIMap"> <area href="http://www.cnn.com/" shape="rect" coords="15, 32, 68, 59"> <area href="http://news.ft.com/home/us/" shape="rect" coords="14, 100, 195, 146"> <area href="http://www.nytimes.com/" shape="rect" coords="16, 186, 185, 211"></map> </head> <body bgcolor="#ddddff" text="#000054" link="#6666FF" vlink="#6666FF"> <p align="left"> </p> <div align="left"> <table border="0" cellpadding="4" cellspacing="0" width="305"> <tr> <td width="117" align="left"> <map name="NHImageMap"> <area href="#" shape="rect" coords="30, 127, 115, 157" <td width="168"><img border="0" src="images/BlankLinks.gif" name="menus"></td> |
The two image maps, HumorLinksIMap and NewsLinksIMap
are developed in the header section of the page. Here the web
pages that should be accessed when each particular rectangle is clicked
are developed. They are invoked using a JavaScript command like
window.document.menus.useMap='#HumorLinksIMap'; Notice the # in front of the image map name. This is necessary! Unfortunately, this sort of JavaScript is available only in Netscape 6 or IE 4 or later. Anyway, when these submenu like images are swapped in, the appropriate image map is invoked so that particular words in the images provide links. |