HTML DOM 영역 모양 속성
정의 및 사용
속성 집합 모양 또는 영역의 모양 속성 값을 반환합니다.
형상 특성 영역의 이미지 맵의 형태를 지정한다.
문법
areaObject.shape=value
모양 속성은 다음의 값을 지정할 수 있습니다 :
值 | 描述 |
---|---|
default | 指定整个地区 |
rect | 定义了一个矩形区域 |
circle | 定义了一个圆形区域 |
poly | 定义一个多边形区域 |
브라우저 지원
모든 주요 브라우저에서 모양 속성을 지원
예
예
다음 예제는 이미지 맵 "비너스"영역의 모양을 반환합니다 :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星区域的形状:
<script>
document.write(document.getElementById("venus").shape);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星区域的形状:
<script>
document.write(document.getElementById("venus").shape);
</script>
</p>
</body>
</html>
위의 출력의 예 :
金星区域的形状: circle
»시도
지역 객체