jQuery Map Hilighterプラグインを使用していますが、各領域の暗いパッチをフェードする代わりに、これを逆にして周囲の領域を暗くし、ホバーした領域を同じ色に保ちたいと考えています。
プラグインのコードを調べたところ、強調表示を行うために canvas 要素 (および私が推測する MS の同等物) を使用しているようです。ただし、Firebug は、形状が定義されている正確な場所についてはあまり公開していません。上記のデモでは、次のようになっています。
<canvas style="border: 0pt none ; padding: 0pt; width: 960px; height: 593px; position: absolute; left: 0pt; top: 0pt; opacity: 1;" height="593" width="960"></canvas>
また、ホバーする要素の形状を指定するものは何も表示されません。これは、形状を作成しているように見える JS の一部です。
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);
}
};