You are here: Reference > JavaScript > client-side > browser > properties > updateInterval (screen)

updateInterval property (screen)

Browser support:
Specifies or returns the time interval (in milliseconds) between screen updates.
A value of 0 means that the update interval depends on the system, not the value of the updateInterval property.

Syntax:

object.updateInterval;
You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

Integer that sets or retrieves the time interval, in milliseconds. Default is 0.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the updateInterval property:
<head>
    <script type="text/javascript">
        function Init () {
            setInterval (Animate, 50);
        }

        function Animate () {
            var flying = document.getElementById ("flying");
            var leftPos = parseInt (flying.style.left);
            leftPos += 10;
            if (leftPos > 400)
                leftPos = 0;
            flying.style.left = leftPos + "px";
        }

        function ModifyUpdateInterval (selectTag) {
            screen.updateInterval = selectTag.value;
        }
    </script>
</head>
<body onload="Init ();">
    <div id="flying" style="position:absolute; left:0px; top:200px; background-color:#e0a0a0;">Flying</div>

    You can modify the update interval of the screen with the following selection list:
    <select onchange="ModifyUpdateInterval (this)">
        <option value="0">0</option>
        <option value="200">200</option>
        <option value="500">500</option>
        <option value="1000">1000</option>
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content