简体   繁体   English

如何在html中的图像映射中填充颜色?

[英]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.可能最快/最简单的方法是使用 James Treworgy 的ImageMapster jQuery 插件

http://www.outsharked.com/imagemapster/ 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 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.通过调用$('img').mapster(options) ,ImageMapster 将尝试绑定到每个具有关联地图的图像。 An area within the image map can be selected with $('area').mapster('select') .可以使用$('area').mapster('select')图像地图内的$('area').mapster('select') The project has lots of options and features.该项目有很多选项和功能。

Here is code for a somewhat basic example:这是一个基本示例的代码:

https://jsfiddle.net/nYkAG/ https://jsfiddle.net/nYkAG/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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