Area shapeプロパティ

Area 对象参考手册Area オブジェクト

定義と用法

shape プロパティは、ある領域の shape 属性値を設定または返します。

shape プロパティは、イメージマップ内の領域の形状を指定します。

構文

areaObject.shape=value

shape プロパティには以下の値を指定できます:

值 説明
default 領域全体を指定します
rect 矩形の領域を定義します
circle 円形の領域を定義します
poly 多角形の領域を定義します


ブラウザサポート

Internet ExplorerFirefoxOperaGoogle ChromeSafari

すべての主要ブラウザは shape プロパティをサポートしています。


例

例

次の例では、イメージマップ内の "Venus" 領域の形状を返します:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
</head>
<body>

<img src="planets.gif.html" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm.html">
</map>
<p>金星領域の形状:
<script>
document.write(document.getElementById("venus").shape);
</script>
</p>

</body>
</html>

上記の例の出力結果:

金星領域の形状: circle

試してみる »


Area 对象参考手册Area オブジェクト その他の拡張