Html5 image hotspot area, map usage,

Source: Internet
Author: User

Html5 image hotspot area, map usage,

Today, I saw an html5 tag that creates a hotspot on the image. The so-called image hotspot is to give you an image and then you can set to click different image locations to access different links! If the following is an image, you can access other webpages in the rectangle, circle, and triangle area!

 

Next, we will introduce the usage of map and area labels!

 

1. Create a rectangular hotspot

(1) the shape label indicates the shape of the hotspot, including the rectangle, circle, polygon, and default)

(2) coords is the coordinates of each shape. The coordinates of different shapes indicate different! The coordinates of the above rectangle (x1, y1, x2, y2), where (x1, y1) are the coordinates of the upper left corner of the rectangle, (x2, y2) is the coordinates of the lower right corner of the rectangle

 

2. Create a circular hotspot

The coordinates of the circle (x, y, radius), where (x, y) is the coordinates of the center, radius is the radius of the circle

 

3. Create a polygon hotspot (triangle below)

Coordinates of a polygon (x1, y1, x2, y2, x3, y3 ,...) the number of group (x, y) coordinates has several angles. That is to say, the coordinates of each angle of a polygon must be in coords!

Note:

1. coords coordinates are based on the image size, not the browser window size! So the coordinates in the upper left corner of the image are (0, 0), and the lower right corner is (the image length and image width)

2. Generally, the coordinates of the desired region cannot be viewed by eyes alone. Therefore, you need to use the screenshot tool to determine the coordinates of the region! Open the screenshot tool and draw the desired point from the upper left corner of the image. The length and width are the coordinates of the point!

Do you want to get updates from Wang yelou's personal blog every day? Add the Public Account"Ly89cn", Or scan the QR code below!

This article from Wang yelou's personal blog, this article address: http://www.ly89.cn/detailB/62.html

You are welcome to share this article. For more information, see the source and address of this article.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.