--- title: document.getBoxObjectFor slug: Web/API/Document/getBoxObjectFor tags: - DOM - Document - Method - Obsolete - Reference - メソッド translation_of: Web/API/Document/getBoxObjectFor ---
指定要素の boxObject (x 座標 / y 座標 / 幅 / 高さ) を返します。
boxObject = document.getBoxObjectFor(element);
var myDiv = document.getElementById("myDiv"),
boxObj = document.getBoxObjectFor (myDiv);
alert (
"x:" + boxObj.x +
", y:" + boxObj.y +
", Width:" + boxObj.width +
", Height:" + boxObj.height
);
このメソッドは nsIXULDocument.idl で定められました。
{{Compat("api.Document.getBoxObjectFor")}}