1

jquery maphighlight を使用していますが、イメージ マップ上の個々の領域を強調表示する際に問題があります。たとえば、id2 と id4 を使用して領域を常に強調表示できるようにする必要があります。これにより、常に別の色になり、他の領域をクリックすると色が変わります。オンのまま、今は赤をオンロードしますが、オンクリックすると色が消えます.mapは私が使用する画像のクラスです,

$(document).ready(function() {
$('.map').maphilight({
  fillColor: 'FF00000',
  fillOpacity: 0.5
});

var data = $('#id3').data('maphilight') || {};  
data.alwaysOn = !data.alwaysOn;
$('#id34').data('maphilight', data).trigger('alwaysOn.maphilight'); 
});

しかし、私はこのようなIDで特定のエリアを呼び出したいのですが、うまくいきません

これらは、私がcする必要がある領域の一部です

<img src="/images/test_map.png" class="map" usemap="#simple" />

<map class="tabs" name="simple">  
<area id="id1" href="#" shape="poly" coords="364,296,386,265,410,280,403,291,367,299" alt="Link" title=""/>
<area id="id2" href="#" shape="poly" coords="428,258,403,291,444,283,452,273" alt="Link" title=""/>
<area id="id3" href="#" shape="poly" coords="403,243,427,259,409,279,389,264" alt="Link" title=""/>
<area id="id4" href="#" shape="poly" coords="417,220,442,236,426,255,403,241" alt="Link" title=""/>
<area id="id5" href="#" shape="poly" coords="466,251,451,272,428,258,442,237" alt="Link" title=""/>

誰かがそれを行う方法を知っていますか? 必要なのは、土地が購入されたことを示すために、マップ上のいくつかの領域を別の色で強調表示することだけです. メタデータは maphighlight でどのように機能しますか?

4

0 に答える 0