عقارات كوردس المنطقة
مثال
احصل على إحداثيات منطقة معينة في خريطة الصورة:
var x = document.getElementById("venus").coords;
التعريف والاستخدام
تقوم خاصية coords بتعيين أو إرجاع قيمة سمة coords لمنطقة ما.
تحدد سمة coords إحداثيات x و y للمنطقة.
تُستخدم سمة coords مع سمة الشكل لتحديد حجم المنطقة وشكلها وموضعها.
نصيحة: إحداثيات الزاوية العلوية اليسرى للمنطقة هي 0،0.
تلميح: استخدم خاصية الشكل لتعيين أو إرجاع قيمة سمة الشكل لمنطقة ما.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
coords | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
إعادة خاصية الكورد:
areaObject.coords
اضبط خاصية الكورد:
areaObject.coords = value
قيم الملكية
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 |
تفاصيل تقنية
قيمة الإرجاع: | سلسلة ، تمثل قائمة إحداثيات مفصولة بفواصل |
---|
مزيد من الأمثلة
مثال
قم بتغيير إحداثيات منطقة معينة في خريطة الصورة:
document.getElementById("venus").coords = "90, 58, 3";
الصفحات ذات الصلة
مرجع HTML: HTML <area> سمة coords
❮ كائن المنطقة