![]() ![]() It’s best to use a server-side map whenever the map has many areas, or where the areas are not easily defined by simple shapes such as circles, rectangles and polygons. So in the above example, the coordinates would be contained in the fields shapes_image.x and shapes_image.y. In this case, the (x,y) coordinates are sent as form fields named fieldname.x and fieldname.y. The coordinates are appended as parameters to the end of the script URL:įor example, if you wanted the user to choose a country from a world map image, you could use the server-side script to calculate which country was clicked on, and then display information about that country.Īnother way of creating a server-side image map is with the image input type in web forms: Then, when you click on the image, the browser sends the (x,y) coordinate of the point that you clicked on to the server-side script, which can then interpret these (x,y) values and take an appropriate action. To define a server-side map, you simply include the ismap attribute, and place an tag around the image, specifying the server-side script to send the (x,y) information to: With this type of map, the browser simply sends the (x,y) coordinates of the point clicked on to a server-side script (such as a CGI script). Server-side image mapsĪs an alternative to defining the whole image map in HTML for the browser to read, you can use server-side image maps. When the mouse is rolled over this hot spot, the browser will usually pop up a tool tip displaying this title. This attribute allows you to give the area a title. Again, it works just like the target attribute in a standard tag. This is the optional target window or frame to open the linked URL in. You can specify a nohref attribute instead, in which case the hot spot will not link to anything. This is the URL that you’d like to link the hot spot to. Note also that the default shape type does not need any coordinates. In other words, the top left corner always has coordinates (0,0). Note that all coordinate values are relative to the top left corner of the image. (The top left and bottom right corners of the rectangle) The coordinates depend on the shape specified in the shape attribute: Shape Specifies the coordinates that define the corners of the shape.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |