Alan kodları Özellik
Örnek
Bir görüntü haritasındaki belirli bir alanın koordinatlarını alın:
var x = document.getElementById("venus").coords;
Tanım ve Kullanım
coords özelliği, bir alanın coords niteliğinin değerini ayarlar veya döndürür.
coords özelliği, bir alanın x ve y koordinatlarını belirtir.
Coords niteliği, bir alanın boyutunu, şeklini ve yerleşimini belirtmek için şekil niteliğiyle birlikte kullanılır.
İpucu: Bir alanın sol üst köşesinin koordinatları 0,0'dır.
İpucu: Bir alanın şekil özniteliğinin değerini ayarlamak veya döndürmek için şekil özelliğini kullanın .
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
coords | Yes | Yes | Yes | Yes | Yes |
Sözdizimi
cocords özelliğini döndürün:
areaObject.coords
Coors özelliğini ayarlayın:
areaObject.coords = value
Mülk değerleri
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 |
Teknik detaylar
Geri dönüş değeri: | Virgülle ayrılmış bir koordinat listesini temsil eden bir Dize |
---|
Daha fazla örnek
Örnek
Bir görüntü haritasındaki belirli bir alanın koordinatlarını değiştirin:
document.getElementById("venus").coords = "90, 58, 3";
İlgili Sayfalar
HTML referansı: HTML <alanı> kodları özniteliği
❮ Alan Nesnesi