1

My question is larger than the title. I want to apply transparency to most of the states and highlight about 6 states with a color.

The instructions on the github page are definitely written from a programmers POV. Can someone help me understand how I target individual states with CSS?

I tried, #jqvmap1_il {color:#930; background-color:#F60;} - which is targeting Illinois, but the inline CSS overrides the change.

4

1 回答 1

6

JQVMap 的文档说你应该将一个对象传递给colors参数......

各个地图区域的颜色。颜色对象的键是符合 ISO 3166-1 alpha-2 标准的国家代码。颜色键必须小写。

这是如何完成的示例...

var highlighted_states = {
   il: '#f60',
   mo: '#f60',
   tx: '#f60',
   ut: '#f60',
}

jQuery('#vmap').vectorMap({
    map: 'usa_en',
    color: '#ffffff',
    colors: highlighted_states
});
于 2013-03-20T00:09:23.613 回答