Mam klasicku mapu v html :
<img border="0" src="F3RC107301.png" usemap="#map" class="map">
<map name="map">
<area id="MAO01" coords="90,142,214,156" shape="rect" alt="MAO01" >
<area id="MAO02" coords="313,141,488,156" shape="rect" alt="MAO02"> atd...
z ineho textu zavolam aby sa polia MAO01 a MAO02 vyfarbili:
cez : span id="t1" onClick="vyfarbi('t1', '#MAO01,#MAO03')
function vyfarbi(cim, co){
xy = cim;
coVyfarbim = co;
$('#' + xy).click(function(e) {
e.preventDefault();
var data = $()coVyfarbim.mouseout().data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$()coVyfarbim.data('maphilight', data).trigger('alwaysOn.maphilight');
});
Vsetko funguje ok ale potreboval by som pred vyfarbenim vymazat vsetky vyfarbene polia...
Ako na to?
Metoda priamo na spravu a spravanie mapy je:
$(function() {
$('.map').maphilight({fade: false});
});
dakujem za kazdu radu