Я прошу прощения за мой глупый вопрос, но мне нужна помощь.Я пытаюсь навести курсор на регион, который я выбрал в таблице, но он работает только в Firefox, а не в Chrome, IE, EDGE ...
Если кто-нибудь может мне помочь, я был бы очень признателен!
<table id="countries">
<tr>
<td id="PNZ">some_name</td>
<td id="CRI">some-name</td>
</tr>
</table>
<div id="Map" style="width: 100%; height: 600px; position: relative;">
</div>
function findRegion(robj, rname) {
var code = '';
$.each(robj, function (key) {
if (unescape(encodeURIComponent(robj[key].config.name)) === unescape(encodeURIComponent(rname))) {
code = key;
};
});
return code;
};
$.getJSON('cdata.json', function (cdata) {
$('#Map').vectorMap({
map: 'ru_mill'
});
var mapObj = $('#RussiaMap').vectorMap('get', 'mapObject');
$('#countries').on('click', 'tr > td', function (event) {
// event.preventDefault();
var elem = event.target,
evtype = event.type,
cntrycode = findRegion(mapObj.regions, $(elem).text());
if (evtype === 'click') {
mapObj.regions[cntrycode].element.setHovered(true);
} else {
mapObj.regions[cntrycode].element.setHovered(false);
};
});