Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Recalculates all dynamic properties in the current document.
Syntax
HRESULT recalc( VARIANT_BOOL fForce );
Parameters
- fForce
- Optional. If set to TRUE, this method will evaluate all expressions in the document. If set to FALSE, the default, only those expressions that reference properties that have changed since the last recalculation will be recalculated.
Return Value
Returns S_OK if the function was bound successfully, or an error value otherwise.
Remarks
Note For the current beta of Microsoft® Internet Explorer 5, implicit dependencies, internal property changes, and related properties may result in some expressions not being recalculated even though the properties they reference may have changed.
Implicit dependencies refer to properties that may be altered by changes in other properties. For instance, the height of a DIV is implicitly dependent upon the innerHTML of the DIV. However, if an expression references the height, a change in the innerHTML (which may alter the height) would not cause a recalculation of the expression on a subsequent call to recalc.
Internal property changes may not prompt recalculations of expressions referencing such properties on subsequent calls to recalc. For instance, resizing the main window changes document.body.clientWidth. Expressions that reference clientWidth may not get recalculated because the change may not be recognized.
Related properties are properties that access or manipulate data or behavior that is also accessed or manipulated by one or more other properties. For instance, both pixelLeft and posLeft set or retrieve the left position of the element. However, if an expression that references element.pixelLeft and element.posLeft is altered, the expression may not be recalculated on subsequent calls to recalc.
Related properties that may result in this behavior include:
clientHeight, clientLeft, clientTop, clientWidth, height, left, offsetHeight, offsetLeft, offsetTop, offsetWidth, pixelHeight, pixelLeft, pixelTop, pixelWidth, posHeight, posLeft, posTop, posWidth, top
To guard against these issues, authors should refer to the same property name or manually call recalc(true) to force recalculations of all expressions.
Dynamic properties behavior for the final release of Internet Explorer 5 will recognize and recalculate related properties, implicit dependencies, and internal property changes.
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.