最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

recalc Method

Internet Development Index

Recalculates all dynamic properties in the current document.

Syntax

document.recalc( [bForceAll])

Parameters

bForceAll Optional. Boolean爐hat specifies one of the following values:
falseDefault. Recalculates only those expressions that have changed since the last recalculation.
trueRecalculates all expressions in the document.

Return Value

No return value.

Remarks

Implicit dependencies, internal property changes, and related properties can cause some expressions not to recalculate, even though the properties being referenced might have changed. For example, resizing the main window changes the clientWidth property. Expressions that reference clientWidth might not be recalculated, because the change might not be recognized.

Implicit dependencies refer to properties that can be altered by changes in other properties. For example, the height of a div implicitly depends on the innerHTML of the div. However, if an expression references the height, a change in the innerHTML, which might alter the height, does not cause a recalculation of the expression on a subsequent call to recalc.

Related properties can access or manipulate data or behaviors through one or more other properties. For example, pixelLeft and posLeft can set or retrieve the left position of the element. However, if an expression that references pixelLeft and posLeft is altered, the expression might not be recalculated on subsequent calls to recalc.

Related properties that can cause this behavior include the following: clientHeight, clientLeft, clientTop, clientWidth, height, left, offsetHeight, offsetLeft, offsetTop, offsetWidth, pixelHeight, pixelLeft, pixelTop, pixelWidth, posHeight, posLeft, posTop, posWidth, and top.

To force recalculations of all expressions, you should refer to the same property name or manually call recalc(true).

Example

The following example uses the recalc method in HTML and script to help create a timer. If the calls to recalc are commented out, the timer does not work correctly.

<HTML>
<HEAD>
<TITLE>Recalc Example</TITLE>
<STYLE>
BUTTON {font-size:14;width:150}
</STYLE>
<SCRIPT>
var timerID = null;
var seconds = 0;
//
// This function is called when the page loads.
// It sets up a couple of expressions.
//
function init()
{
A.style.setExpression("width","seconds*10");
B.setExpression("innerText","seconds.toString()");
}
//
// This function gets calls once a second and updates the seconds
// variable. Notice that without recalc, the expressions aren't
// updated until the mouse is moved.
//
function timer()
{
seconds++;
document.recalc();
}
//
// starts the timer
//
function starttimer()
{
if (timerID == null)
{
timerID = setInterval("timer()", 1000);
startButton.disabled = true;
stopButton.disabled = false;
}
}
//
// stops the timer
//
function stoptimer()
{
if (timerID != null)
{
clearInterval(timerID);
timerID = null;
startButton.disabled = false;
stopButton.disabled = true;
}
}
//
//  resets the timer
//
function resettimer()
{
seconds = 0;
}
</SCRIPT>
</HEAD>
<BODY onload="init()">
<DIV id=A style="background-color:lightblue" ></DIV>
<DIV id=B style="color:hotpink;font-weight:bold"></DIV>
<BR>
<BUTTON id="startButton" onclick="starttimer()">Start the Timer</BUTTON></BR>
<BUTTON id="stopButton" DISABLED="true" onclick="stoptimer()">Stop the Timer</BUTTON><BR>
<BUTTON id="resetButton" onclick="resettimer()">Reset the Timer</BUTTON><BR>
<P style="width:320;color:peru;background-color:wheat">
This example illustrates the use of document.recalc().  If the calls
to recalc are omitted in this example, expressions will not be updated
until the mouse is moved.
</P>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

document

See Also

About Dynamic Properties, getExpression, removeExpression, setExpression
乳山市| 武功县| 旅游| 轮台县| 南靖县| 偃师市| 贺州市| 五家渠市| 承德市| 新民市| 壶关县| 奎屯市| 额济纳旗| 柏乡县| 临沧市| 鹤峰县| 盱眙县| 昭苏县| 潼南县| 图们市| 德安县| 白沙| 莎车县| 南丹县| 肥乡县| 巫溪县| 阿拉善左旗| 濮阳县| 东乌| 绥德县| 凤翔县| 芦山县| 城市| 武定县| 通辽市| 丹江口市| 沙河市| 南陵县| 稻城县| 互助| 淮安市|