offsetHeight Property (IHTMLElement)

来源:百度文库 编辑:神马文学网 时间:2024/04/24 19:33:48
IHTMLElement::offsetHeight Property
Retrieves the height of the object relative to the layout or coordinate parent, as specified by theIHTMLElement::offsetParent property.
Syntax
HRESULT IHTMLElement::get_offsetHeight(long *p);
Parameters
p
Pointer to a variable of type long thatreceives the height, in pixels.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
You can determine the location, width, and height of an object by using a combination of theIHTMLElement::offsetLeft,IHTMLElement::offsetTop, IHTMLElement::offsetHeight, andIHTMLElement::offsetWidthproperties. These numeric properties specify the physical coordinatesand dimensions of the object relative to the object's offset parent.
Formore information about how to access the dimension and location ofelements on the page through the Dynamic HTML (DHTML) Document ObjectModel (DOM), seeMeasuring Element Dimension and Location.
To comply with theCascading Style Sheets, Level 1 (CSS1) box model, Microsoft Internet Explorer 6 and later calculate the height of objects differently when you use the!DOCTYPE declaration in your document to switch on standards-compliant mode. This difference may affect the value of the IHTMLElement::offsetHeight propety. When standards-compliant mode is switched on, theIHTMLStyle::heightproperty specifies the distance between the top and bottom edges of thebounding box that surrounds the object's content. Whenstandards-compliant mode is not switched on, and with earlier versionsof Windows Internet Explorer, the IHTMLStyle::height property also includes theIHTMLStyle::border andIHTMLStyle::padding belts that surround the object's bounding box. For more information, seeCSS Enhancements in Internet Explorer 6.