---
title: css和js两种方式实现div右移1000px动画
created: 2022-07-20
summary: 用keyframes和timer
tags:
  - CSS
  - JavaScript
  - animation
---

<iframe height="500" style="width: 100%;" scrolling="no" title="css和js两种方式实现div右移1000px动画" src="https://codepen.io/sevichee/embed/BarRyRZ?default-tab=html%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href="https://codepen.io/sevichee/pen/BarRyRZ">
  css和js两种方式实现div右移1000px动画</a> by Sowhere (<a href="https://codepen.io/sevichee">@sevichee</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>

参考：[JavaScript 动画](https://zh.javascript.info/js-animation)
