지도 좌표를 사용하여 이미지 맵을 만들었으므로 잘 작동하지만 강조 표시가 필요하지만 강조 표시 색상을 변경하려면 조건에 따라 다릅니다. ... 첫 번째 condtion에서 붉은 색 영역을 강조 표시 한 다음 동일한 영역이 두 번째 조건에 대한 검은 색으로 강조 표시됩니다. 동일한 영역을 강조 표시 할 수 있지만 동시에 영역 색상을 변경할 수 없습니다. 여기에 바이올린에JQuery maphighlight는 조건에 따라 영역 강조 색상을 변경합니다.
는내 샘플 코드 : Fiddle Demo
내가
<script>
$(document).ready(function() //on page load
{
$('area[title*="UPPER"]').each(function()//get all areas
{
$(this).addClass("victory");
});
$('area[title*="LOWER"]').each(function()//get all areas
{
$(this).addClass("lose");
});
//initialize highlight
$('.map').maphilight({ strokeWidth: 0, fillColor: "0000FF", fillOpacity: 0.8, singleSelect: true });
////map wrap
$(".victory").click(function() {
//This block is what creates highlighting by trigger the "alwaysOn",
var data = $(this).data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
//there is also "neverOn" in the docs, but not sure how to get it to work
});
$('.map').maphilight({ strokeWidth: 0, fillColor: "FFFF00", fillOpacity: 0.8});
$(".lose").click(function() {
//This block is what creates highlighting by trigger the "alwaysOn",
var data = $(this).data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
//there is also "neverOn" in the docs, but not sure how to get it to work
});
});
</script>
하지만 두 번째 fillcolor.any 하나의 도움으로 첫하고 fillColor을 덮어이다 사용하여 시도했다 이 문제를 해결하려면 area.style
하지 background-color
속성을 가지고 있기 때문에
같은 좌표로 캔버스를 오버레이합니다 ... –
@ Mr.Alien 얻을 수 없습니다. –
을 설명 할 수 있습니까? http://jsfiddle.net/tZKuv/3/을 확인하십시오. 플러그인 워드 프로세서를 사용하지 않을 것입니다.하지만이 옵션을 사용하게 될 것이라고 생각합니다. –