clearInterval

解释:取消由 setInterval 设置的定时器。

方法参数

Number intervalID
intervalID参数说明 :要取消的定时器的 ID。

示例

跳转编辑工具

在开发者工具中打开

在 WEB IDE 中打开

扫码体验

代码示例

百度智能小程序

请使用百度APP扫码

图片示例

clearInterval - 图2

代码示例

  • SWAN
  • JS
  1. <view class="wrap">
  2. <view class="card-area">
  3. <view class="top-description border-bottom">
  4. <view>Interval</view>
  5. <view>{{Interval}}</view>
  6. </view>
  7. <button type="primary" bindtap="bindSetInterval">setInterval</button>
  8. <button type="primary" bindtap="bindClearInterval">clearInterval</button>
  9. </view>
  10. <view class="card-area">
  11. <view class="top-description border-bottom">
  12. <view>timeout</view>
  13. <view>{{timeout}}</view>
  14. </view>
  15. <button type="primary" bindtap="bindSetTimeout">setTimeout</button>
  16. <button type="primary" bindtap="bindClearTimeout">clearTimeout</button>
  17. </view>
  18. </view>