简体   繁体   中英

How to fill color in an imagemap in html?

This is the code:- '''

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Observers Dashboard hhttps://xd.adobe.com/view/d532ccdf-7a7a-4d1e-a819-5ce157cdbded-8061/screen/a779cae4-5263-465f-a743-e5c8caf68b0a  -->
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>  
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="container-fluid">
<h1>Dashboard</h1>

            
            
         
         

''' This is the image link

I have to fill color in different districts of the image map, how can I achieve that?

Probably the fastest/easiest way to do this is with the ImageMapster jQuery plugin by James Treworgy.

http://www.outsharked.com/imagemapster/

These demos show that it will do exactly what you desire:

http://www.outsharked.com/imagemapster/default.aspx?demos.html

By calling $('img').mapster(options) , ImageMapster will attempt to bind to each image that has an associated map. An area within the image map can be selected with $('area').mapster('select') . The project has lots of options and features.

Here is code for a somewhat basic example:

https://jsfiddle.net/nYkAG/

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