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 对象