Area coords 屬性
描述
coords 屬性設定或返回 area 的 coords 屬性值。
coords 屬性指定區域的 x 和 y 座標。
coords 屬性與 shape 屬性一起使用,以指定區域的大小、形狀和位置。
提示:區域左上角的座標為 0,0。
提示:使用 shape 屬性來設定或返回 area 的 shape 屬性值。
瀏覽器支援
屬性 | |||||
---|---|---|---|---|---|
coords | 是 | 是 | 是 | 是 | 是 |
語法
返回 coords 屬性
areaObject.coords
設定 coords 屬性
areaObject.coords = value
屬性值
值 | 描述 |
---|---|
x1, y1, x2, y2 | 如果 shape 屬性設定為 "rect",則指定矩形左上角和右下角的座標 |
x, y, radius | 如果 shape 屬性設定為 "circle",則指定圓心座標和半徑 |
x1, y1, x2, y2, .., xn, yn | 如果 shape 屬性設定為 "poly",則指定多邊形邊的座標。如果第一對和最後一對座標不相同,瀏覽器必須新增最後一對座標來閉合多邊形 |
技術詳情
返回值 | 一個字串,表示逗號分隔的座標列表 |
---|
更多示例
相關頁面
HTML 參考: HTML <area> coords 屬性
❮ Area 物件