相关文章推荐
飘逸的饭卡  ·  《asyncio 系列》9. 使用基于 ...·  3 月前    · 
爱跑步的感冒药  ·  我可以在 Anaconda base ...·  3 年前    · 
冲动的八宝粥  ·  docker 反向代理 ...·  3 年前    · 
腼腆的松球  ·  记一次MySQL迁移并从MySQL5.6升级 ...·  3 年前    · 
考研的包子  ·  pyqt5开发(3)PyQtGraph ...·  3 年前    · 
Code  ›  Animation.cancel() - Web API 接口参考 | MDN
mdn web开发 web技术
https://developer.mozilla.org/zh-CN/docs/Web/API/Animation/cancel
曾深爱过的苦咖啡
3 年前
  • Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Web Technology

      Web technology reference for developers

  • Guides
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help (beta)

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Blog
  • Play New
  • AI Help Beta
  • Log in
  • Sign up for free
  1. Web 开发技术
  2. Web API 接口参考
  3. Animation
  4. Animation.cancel()

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

In this article

  • 语法
  • 规范
  • 浏览器兼容性
  • 相关内容
  1. Web Animations API
  2. Animation
  3. 构造函数
    1. Animation()
  4. 实例属性
    1. currentTime
    2. effect
    3. finished
    4. id
    5. pending (en-US)
    6. playbackRate (en-US)
    7. playState
    8. ready (en-US)
    9. replaceState (en-US)
    10. startTime
    11. timeline (en-US)
  5. 实例方法
    1. cancel()
    2. commitStyles() (en-US)
    3. finish()
    4. pause() (en-US)
    5. persist() (en-US)
    6. play()
    7. reverse() (en-US)
    8. updatePlaybackRate() (en-US)
  6. 事件
    1. cancel
    2. finish (en-US)
    3. remove (en-US)
  7. 继承
    1. EventTarget
  8. Web Animations 的相关页面
    1. AnimationEffect (en-US)
    2. AnimationEvent
    3. AnimationPlaybackEvent (en-US)
    4. AnimationTimeline
    5. Document.getAnimations() (en-US)
    6. Document.timeline
    7. DocumentTimeline (en-US)
    8. Element.animate()
    9. Element.getAnimations() (en-US)
    10. KeyframeEffect (en-US)
    11. ScrollTimeline (en-US)
    12. ViewTimeline (en-US)

In this article

  • 语法
  • 规范
  • 浏览器兼容性
  • 相关内容

Animation.cancel()

实验性: 这是一项 实验性技术
在将其用于生产之前,请仔细检查 浏览器兼容性表格 。

Animation 接口的 Web 动画 API 的 cancel() 方法将清除此动画造成的所有 KeyframeEffect (en-US) ,并中止其播放。

备注: 当一个动画被取消时,其 startTime 和 currentTime 被设置为 null。

语法

Animation.cancel();

参数

无。

返回值

无。

异常

这个方法不会直接抛出异常; 但是,如果动画的 playState 取消时是除了“空闲”之外的任何东西, current finished promise 被拒绝与一个 DOMException 命名的 AbortError .

规范

Specification
Web Animations
# dom-animation-cancel

浏览器兼容性

BCD tables only load in the browser

相关内容

 
推荐文章
飘逸的饭卡  ·  《asyncio 系列》9. 使用基于 asyncio 实现的异步框架构建 Web 应用程序 - 古明地盆
3 月前
爱跑步的感冒药  ·  我可以在 Anaconda base (root) 中更新到 Python 3.9 或 3.10 吗?
3 年前
冲动的八宝粥  ·  docker 反向代理 DNS/网络问题_docker_云O生-云原生
3 年前
腼腆的松球  ·  记一次MySQL迁移并从MySQL5.6升级到5.7后查询慢了几十倍的问题 - 掘金
3 年前
考研的包子  ·  pyqt5开发(3)PyQtGraph 绘图 - MKT-porter - 博客园
3 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号