需要对地图内的区域标记进行样式化 [英] Need to stylize area tag inside map

查看:161
本文介绍了需要对地图内的区域标记进行样式化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有图片和区域

 < map name =number_areas> 
< area href =#shape =polycoords =190,1,285,1,285,95,190,94id =area6>
....

有无法为区域标签设置CSS样式,透明度等?

解决方案

不可能使用css更改直接向区域分配样式。

另一种方式是使用SVG文件。



这里有一个例子: JSFIDDLE



在您拥有此css的示例中,可以为您的svg创建样式:

  polygon.hoverable 
{
fill:transparent;
stroke:gray; / *如果你喜欢,替换为none * /
stroke-width:4;
cursor:pointer;
}

polygon.hoverable:hover
{
stroke:black;
}

其他方法是在javascript / jQuery中使用一些插件: p>

ImageMapster


I have image and areas located inside

<map name="number_areas">
    <area href="#" shape="poly" coords="190,1,285,1,285,95,190,94" id="area6">
    ....

Is there way to set css styles for area tag, like background, transparency etc?

解决方案

Isn't possible with css to change assign style to area directly.
Another way is to use SVG file

Here's an example I whipped up: JSFIDDLE.

in the example you have this css that can make a style to your svg:

polygon.hoverable
{
    fill: transparent;
    stroke:gray; /* Replace with none if you like */
    stroke-width: 4;
    cursor: pointer;
}

polygon.hoverable:hover
{
 stroke:black;   
}

Other way is to use some plugin in javascript/jQuery like this:

ImageMapster

这篇关于需要对地图内的区域标记进行样式化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆