Area koördineer Eiendom
Voorbeeld
Kry die koördinate vir 'n spesifieke area in 'n beeldkaart:
var x = document.getElementById("venus").coords;
Definisie en gebruik
Die coords-eienskap stel of gee die waarde van die coords-kenmerk van 'n area terug.
Die coords-kenmerk spesifiseer die x- en y-koördinate van 'n area.
Die coords-kenmerk word saam met die shape-kenmerk gebruik om die grootte, vorm en plasing van 'n area te spesifiseer.
Wenk: Die koördinate van die boonste linkerhoek van 'n area is 0,0.
Wenk: Gebruik die vorm -eienskap om die waarde van die vormkenmerk van 'n area te stel of terug te gee.
Blaaierondersteuning
Property | |||||
---|---|---|---|---|---|
coords | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Gee die coords-eienskap terug:
areaObject.coords
Stel die coords-eienskap:
areaObject.coords = value
Eiendomswaardes
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 |
Tegniese besonderhede
Terugkeerwaarde: | 'n String, wat 'n kommageskeide lys koördinate verteenwoordig |
---|
Meer voorbeelde
Voorbeeld
Verander die koördinate vir 'n spesifieke area in 'n beeldkaart:
document.getElementById("venus").coords = "90, 58, 3";
Verwante bladsye
HTML verwysing: HTML <area> coords kenmerk
❮ Areavoorwerp