I'm using this map plugin.
When I click on each country, I want to change the text in a div called #content
, which is invisible by default.
I planned to make it by using a different div called #apDiv3
.
Content after first click should stay visible until you click another country.
I'm using this code but nothing happens:
$(function () {
$('#example-map-1').vectorMap({
backgroundColor: ('#1d1e21'),
hoverOpacity: 0.7,
hoverColor: ('#4f1d1e'),
onRegionClick: function (event, code) {
if(code === 'ca') {
event(function () {
$("#content").replaceWith($("#apDiv3"))
});
}
});
});
});
What am I doing wrong, and is there a better way to do this?