Đang chuẩn bị liên kết để tải về tài liệu:
Học JavaScript qua ví dụ part 45

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Làm việc với Imagemaps Imagemap An là một hình ảnh với các khu vực có thể click nơi mỗi khu vực được đại diện bởi một liên kết, còn được gọi là một điểm nóng. Imagemap An làm cho nó có thể tạo một liên kết hình ảnh vào một vài trang tùy theo khu vực hoặc pixel phối hợp các vị trí bấm vào bởi người sử dụng | 422 Chapter 12 Working with Images and Links Figure 12.5 After clicking on a hyperlink Output from Example 12.2. 12.3 Working with Imagemaps An imagemap is an image with clickable areas where each area is represented by a link also called a hotspot. An imagemap makes it possible to make one image link to several pages depending on the area or pixel coordinate positions clicked by the user. A simple example would be an image of the map of the United States. If the user clicks on Maine for example then a link would navigate the user to another page with information about that state a closer image of the state and so forth. In the HTML page you simply specify the area of the image hotspot and the link that will be associated with that part of the image. The most time-consuming and boring part of this process is determining the coordinate positions for the hotspot. This can be done manually or by an image mapping program. There are a number of programs on the Web to help you see Figure 12.6 and many are free. In fact most HTML editors have image mapping as a built-in function see Figures 12.7 and 12.8 . From the Library of WoweBook.Com 12.3 Working with Imagemaps 423 Figure 12.6 A free online image mapping tool. From the Library of WoweBook.Com 424 Chapter 12 Working with Images and Links Figure 12.7 Using the tool to map a rectangular hotspot. Figure 12.8 Using the image mapping tool to get the coordinates of the hotspot. Coordinates are for the highlighted rectangular shape. In Example 12.3 if you click on the face of any of the people in the family you are linked to a page with information about that family member. In the HTML page the area tag and its attributes represent the coordinates and the shape of the image map see Table 12.5 as well as a link to the navigation page where the user will be directed when he or she clicks on the hotspot. Example 12.3 demonstrates how to create an image map. From the Library of .