Oblastní souřadnice Vlastnost
Příklad
Získejte souřadnice pro konkrétní oblast na obrázkové mapě:
var x = document.getElementById("venus").coords;
Definice a použití
Vlastnost coords nastavuje nebo vrací hodnotu atributu coords oblasti.
Atribut coords určuje souřadnice x a y oblasti.
Atribut coords se používá spolu s atributem shape k určení velikosti, tvaru a umístění oblasti.
Tip: Souřadnice levého horního rohu oblasti jsou 0,0.
Tip: Pomocí vlastnosti shape nastavte nebo vraťte hodnotu atributu shape oblasti.
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
coords | Yes | Yes | Yes | Yes | Yes |
Syntax
Vraťte vlastnost coords:
areaObject.coords
Nastavte vlastnost coords:
areaObject.coords = value
Hodnoty vlastností
Value | Description |
---|---|
x1, y1, x2, y2 | If the shape attribute is set to "rect", it specifies the coordinates of the top-left corner and the bottom-right corner of the rectangle |
x, y, radius | If the shape attribute is set to "circle", it specifies the coordinates of the circle center and the radius |
x1, y1, x2, y2, .., xn, yn | If the shape attribute is set to "poly", it specifies the coordinates of the edges of the polygon. If the first and last coordinate pairs are not the same, the browser must add the last coordinate pair to close the polygon |
Technické údaje
Návratová hodnota: | Řetězec představující seznam souřadnic oddělených čárkami |
---|
Další příklady
Příklad
Změňte souřadnice pro konkrétní oblast v obrazové mapě:
document.getElementById("venus").coords = "90, 58, 3";
Související stránky
HTML reference: HTML <area> coords atribut
❮ Oblastní objekt