我需要在区域上打开一个颜色框,点击jqvmap http://jqvmap.com/
jQuery('#wine-map').vectorMap({
map: 'world_en',
backgroundColor: '#000',
color: '#ffffff',
hoverOpacity: 0.7,
selectedColor: '#666666',
enableZoom: true,
scaleColors: ['#ffffff', '#eeeeee'],
normalizeFunction: 'polynomial',
onRegionClick: function(element, code, region){
if (code == 'us') {
var message = "wines usa"
alert(message);
}
}
});
因此,我要求内联内容html通过colorbox显示而不是警报。
http://www.jacklmoore.com/colorbox/example1/
我试过了
jQuery('#wine-map').vectorMap({
map: 'world_en',
backgroundColor: '#000',
color: '#ffffff',
hoverOpacity: 0.7,
selectedColor: '#666666',
enableZoom: true,
scaleColors: ['#ffffff', '#eeeeee'],
normalizeFunction: 'polynomial',
onRegionClick: function(element, code, region){
if (code == 'us') {
$.colorbox({html:'<h2>Areas in the USA</h2><ul><li><a href="#">California</a></li></ul> '});
}
}
});
哪个有效,但我需要调用内联内容......这个内联内容:
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<h2>Areas in the USA</h2>
<ul>
<li><a href="#">California</a></li>
</ul>
</div>
</div>