简体   繁体   中英

Image clickable multiple areas approach

I've just started to learn web development and I have an idea to do the following: Take simple image (jpeg/png) and make some areas of that image clickable (or other events on those areas). For example, when I click on specific area on the image, this area highlights, other part of the image shadows. First what I googled was HTML map/area tags. But I want to know other approaches which I can use to do that. Just give me some keywords, nothing more.

Thanks in advance

I stumbled upon the same problem some time ago:

  • HTML maps tags are the quickest way but in the long run often give problems often because of the lack of support.
  • Going for an SVG image which is widely supported across all browsers is a good solution. There are many JPEG/PNG to SVG converters on the web (even if quality would not be the same)
  • Another brutal approach is to create some clickable overlay divs over the image, it is a good approach if the areas to click are rectangular.

Hope you find a good solution :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM