Files
freeCodeCamp/guide/chinese/javascript/window-clearinterval-method/index.md
2018-10-16 21:32:40 +05:30

23 lines
610 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Window clearInterval Method
localeTitle: Window clearInterval方法
---
## Window clearInterval方法
'clearInterval'方法用于清除使用'setInterval'方法设置的计时器。
```js
clearInterval(setInteval_ID);
```
为了能够使用'clearInterval'方法,必须使用全局变量。
```js
myID = setInterval(function, milliseconds);
```
#### 更多信息:
文档: [MDN](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval)
关于[w3schools的](https://www.w3schools.com/jsref/met_win_clearinterval.asp)更多例子