> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# animation-delay

APISummary
## 介绍

`animation-delay` 属性指示动画起始播放延迟。

## 使用示例

**下面是一个示例: css-api**

**Entry:** `src/animation-delay`
**Bundle:** `dist/animation-delay.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const AnimationDelay = () => {
  const delaySecondsProps = ["0s", "1s", "2s", "3s", "4s"];
  const delayMilliSecondsProps = ["0ms", "1000ms", "2000ms", "3000ms", "4000ms"];

  const containerStyle = {
    height: "200rpx",
  };

  const columnStyle = {
    width: "250rpx",
  };

  const getAnimationStyle = (delay: string, unit: string = "s") => ({
    animation: `rotateZ-ani 2s ease ${delay}${unit} infinite alternate both running`,
  });

  return (
    <scroll-view scroll-orientation="vertical" className="fd-col container">
      <text className="h1">keyframes animation demo : delay s</text>
      <view className="sep"></view>
      <view className="fd-col group pd5">
        <text className="button h2">delay</text>
        <view className="fd-row" style={containerStyle}>
          {delaySecondsProps.map((item, index) => (
            <view style={columnStyle} className="fd-col mg5" key={item}>
              <text className="h3 mgl15">{item}</text>
              <view flatten={false} style={getAnimationStyle(index.toString())} className="ani-size mg5 mgl15 mgt15" />
            </view>
          ))}
        </view>
      </view>
      <view className="sep"></view>

      <text className="h1">keyframes animation demo : delay ms</text>
      <view className="sep"></view>
      <view className="fd-col group pd5">
        <text className="button h2">delay</text>
        <view className="fd-row" style={containerStyle}>
          {delayMilliSecondsProps.map((item, index) => (
            <view style={columnStyle} className="fd-col mg5" key={item}>
              <text className="h3 mgl15">{item}</text>
              <view
                flatten={false}
                style={getAnimationStyle(index.toString(), "ms")}
                className="ani-size mg5 mgl15 mgt15"
              />
            </view>
          ))}
        </view>
      </view>
      <view className="sep"></view>
    </scroll-view>
  );
};

root.render(<AnimationDelay />);

```

v0.11.0



## 语法

```css
animation-delay: 3s;
animation-delay: 2s, 4ms;
```

## 注意事项

:::caution

- Lynx 默认 `duration` 和 `delay` 需要**有单位**，无单位的写法可能会产生未定义的行为。

:::

## 形式定义

| 初始值 | 0s |
| 适用元素 | all elements |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```css
/*默认值0s*/
animation-delay: <time>;
```

## 扩展阅读

- [animation](/next/zh/api/css/properties/animation.md)
- [animation-name](/next/zh/api/css/properties/animation-name.md)
- [animation-duration](/next/zh/api/css/properties/animation-duration.md)
- [animation-timing-function](/next/zh/api/css/properties/animation-timing-function.md)
- [animation-delay](/next/zh/api/css/properties/animation-delay.md)
- [animation-iteration-count](/next/zh/api/css/properties/animation-iteration-count.md)
- [animation-direction](/next/zh/api/css/properties/animation-direction.md)
- [animation-fill-mode](/next/zh/api/css/properties/animation-fill-mode.md)
- [animation-play-state](/next/zh/api/css/properties/animation-play-state.md)
- [CSS 动画事件](/next/zh/api/lynx-api/event/animation-event.md)
- [Animated API](/next/zh/api/lynx-api/lynx/lynx-animate-api.md)

## 兼容性

**Compatibility Table**

**Query:** `css.properties.animation-delay`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/68-animation-delay.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/animation-delay)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| animation-delay | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`animation-delay`**

**Specifications:**

