0
我试图动态地改变maphilight的颜色。jQuery maphilight动态地改变颜色
reponse = JSON.parse(reponse);
$('area').each(function() {
$(this).attr('data-maphilight', '{"stroke":0, "fillColor":"CCFFCC", "fillOpacity":0.3, "alwaysOn":true}');
// POUR LA CRÉATION DE BD, METS TOUS LES TERRAIN DANS COMMENTAIRES AVEC UN TYPE 1
// $('#commentaireArea').val(($('#commentaireArea').val().concat("('"+$(this).attr('id')+"', 1), \n")));
})
for (var i = 0; reponse.length > i; i++) {
var test = '#'.concat(reponse[i].nomTerrain);
$(test).attr('data-maphilight', '{"stroke":0, "fillColor":"FF0000", "fillOpacity":0.3, "alwaysOn":true}');
}
$('img[usemap]').maphilight();
这只能使用一次。当谈到第二次,它不是!它改变了CSS类,但不是maphilight!