JavaScript Reference/Javascript Methods/clearInterval — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
"clearInterval()" Example
<html>
<body>
<script language="javascript">
var intInterval = 0
function myInterval(){
alert("Hello");
}
</script>
<button onclick="intInterval=window.setInterval("myInterval()", 1000);">Start interval</button>
<button onclick="intInterval=window.clearInterval(intInterval);">Stop interval</button>
</body>
</html>
"clearInterval()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |window |
+----------------+--------------------------------------------------------------+
"clearInterval()" Syntax, Parameters and Note
Note:
Removes an interval initialized by the setInterval() method.
An interval allows a function to be called each time the interval time has elapsed.
Syntax:
window.clearInterval(param1)
Parameters:
param1 Required; the numeric interval ID.