JavaScript Reference/Javascript Methods/clearInterval
Версия от 18:30, 25 мая 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.