aspxtreme

MAP Element | MAP Object

HTML Elements/DHTML Objects


Contains information about the active areas of a client-side image map.

HTML Syntax

Remarks

An image map is a graphic image with predefined areas that provide links to other documents or content. When a user clicks an area in the image map, the browser loads the URL associated with that area.

There are two different kinds of image maps: server-side and client-side image maps. For server-side image maps, the mapping information is written in a separate file that resides on the web server. For client-side image maps, the mapping information is contained in a MAP element.

To define a client-side image map, the MAP object is referenced with the usemap attribute in an IMG element:

<img src="solarsys.gif" usemap="#SolarMap">

As in the above example, the value of usemap must be a hash ( # ) sign, followed by the name of the MAP element that contains the mapping information, which in this case is "#SolarMap".

The MAP element contains a set of AREA elements, each of which define a region in the image and specifies the URL to which it links.

If the user clicks a point located in multiple overlapping areas, the area that is defined first in the MAP responds to the click.

Members



Styles


Example

The following example provides the full code for an image map of the solar system. Clicking on the sun or any planet opens a link to an individual image.

Sample Code


See Also

AREA, IMG



Books and more ...

Contents
HTML Elements / DOM Objects
HTML Element Attributes
CSS Attributes
DOM Object Properties
DOM-compliant Events Reference
DOM Methods Reference
DOM Collections Reference
 


Suggested Reading



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme