Aplicativos do Windows
Recolher sumário
Expandir sumário
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

bottom property

Set or retrieves the bottom coordinate of the rectangle surrounding the object content.

Syntax

JavaScript

p = object.bottom

 

Property values

Type: Integer

the bottom coordinate of the rectangle, in pixels.

Remarks

This syntax shows how to access the bottom coordinate of the second text rectangle of a TextRange object.


oRct = oTextRange.getClientRects();
oRct[1].bottom;

Note that the collection index starts at 0, so the second item index is 1.

This syntax shows how to access the bottom coordinate of the bounding rectangle of an element object.


oBndRct = oElement.getBoundingClientRect();
oBndRct.bottom;

Examples

This example uses the getBoundingClientRect method to retrieve the coordinates of the bounds of the text rectangles within the element.


<script type="text/javascript">
function getCoords(oObject) {
    oBndRct=oObject.getBoundingClientRect();
    console.log("Bounding rectangle = \nUpper left coordinates: "
        + oBndRct.left + " " + oBndRct.top +
        "\nLower right coordinates: "
        + oBndRct.right + " " + oBndRct.bottom);
}
</script>
</head>	
<body>
<p ID=oPara onclick="getCoords(this)">
some text here ... </p>

See also

Reference
left
right
top
TextRectangle

 

 

Mostrar:
© 2017 Microsoft