jQuery Map Hilighter 플러그인을 사용하고 있지만 각 영역에 어두운 패치를 희미하게 사용하는 대신이 부분을 뒤집어서 주변 지역을 어둡게 만들고 끌려 진 영역을 같은 색상으로 유지하고 싶습니다.jQuery 이미지 맵 플러그인에 반전 표시를 추가 하시겠습니까?
나는 플러그인의 코드를 살펴 봤는데 캔버스 요소 (그리고 필자가 추측 한 MS 등가물)를 사용하여 강조 표시를 사용하는 것으로 보입니다.
<canvas style="border: 0pt none ; padding: 0pt; width: 960px; height: 593px; position: absolute; left: 0pt; top: 0pt; opacity: 1;" height="593" width="960"></canvas>
내가 가져가 할 수있는 요소의 모양을 지정 아무것도 볼 수 없습니다 : 그냥이를 보여줍니다 위의 데모에 - 그러나 방화범 정확히 모양이 정의되는 경우 매우 출간되지 않습니다. 요소
add_shape_to = function(canvas, shape, coords, options) {
var i, context = canvas.getContext('2d');
context.beginPath();
if(shape == 'rect') {
context.rect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
} else if(shape == 'poly') {
context.moveTo(coords[0], coords[1]);
for(i=2; i < coords.length; i+=2) {
context.lineTo(coords[i], coords[i+1]);
}
} else if(shape == 'circ') {
context.arc(coords[0], coords[1], coords[2], 0, Math.PI * 2, false);
}
context.closePath();
if(options.fill) {
context.fillStyle = css3color(options.fillColor, options.fillOpacity);
context.fill();
}
if(options.stroke) {
context.strokeStyle = css3color(options.strokeColor, options.strokeOpacity);
context.lineWidth = options.strokeWidth;
context.stroke();
}
if(options.fade) {
fader(canvas, 0);
}
};
안녕하십니까, 응답 해 주셔서 감사합니다.당신이 말한 것을 구현했고 일부 다각형 영역에서 작동하는 것처럼 보입니다. 다른 사람들이 거꾸로 돌아가고 있다고 가정하기 때문에 곧 그 사람들을 분류 할 것입니다. 그러나 원형 요소로는 작동하지 않습니다. 어떤 아이디어? – DisgruntledGoat