-
Notifications
You must be signed in to change notification settings - Fork 1
/
css-animation.html
712 lines (367 loc) · 28.8 KB
/
css-animation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
<!doctype html>
<html class="theme-next mist use-motion">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />
<meta name="keywords" content="前端,css3,animation," />
<link rel="alternate" href="/atom.xml" title="清风轩" type="application/atom+xml" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />
<meta name="description" content="CSS动画现在应用越来越广泛,animation属性是CSS实现动画的一个重要概念;本文将对CSS的属性animation做一个简单的入门介绍。">
<meta property="og:type" content="article">
<meta property="og:title" content="CSS - animation简介">
<meta property="og:url" content="http://xovel.cn/article/css-animation.html">
<meta property="og:site_name" content="清风轩">
<meta property="og:description" content="CSS动画现在应用越来越广泛,animation属性是CSS实现动画的一个重要概念;本文将对CSS的属性animation做一个简单的入门介绍。">
<meta property="og:updated_time" content="2016-11-18T07:00:40.108Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CSS - animation简介">
<meta name="twitter:description" content="CSS动画现在应用越来越广泛,animation属性是CSS实现动画的一个重要概念;本文将对CSS的属性animation做一个简单的入门介绍。">
<script type="text/javascript" id="hexo.configuration">
var NexT = window.NexT || {};
var CONFIG = {
scheme: 'Mist',
sidebar: {"position":"left","display":"post"},
fancybox: true,
motion: true,
duoshuo: {
userId: 0,
author: '博主'
}
};
</script>
<title> CSS - animation简介 | 清风轩 </title>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div style="display: none;">
<script src="http://s6.cnzz.com/stat.php?id=1259096563&web_id=1259096563" type="text/javascript"></script>
</div>
<div class="container one-collumn sidebar-position-left page-post-detail ">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">清风轩</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">清风轩居 - 引仙阁</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br />
首页
</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories" rel="section">
<i class="menu-item-icon fa fa-fw fa-th"></i> <br />
分类
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
标签
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives" rel="section">
<i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
归档
</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about" rel="section">
<i class="menu-item-icon fa fa-fw fa-user"></i> <br />
关于
</a>
</li>
<li class="menu-item menu-item-garden">
<a href="/garden" rel="section">
<i class="menu-item-icon fa fa-fw fa-life-ring"></i> <br />
花园
</a>
</li>
</ul>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<div id="posts" class="posts-expand">
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
CSS - animation简介
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-07-19T17:51:43+08:00" content="2016-07-19">
2016-07-19
</time>
</span>
<span class="post-category" >
|
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="https://schema.org/Thing">
<a href="/categories/web/" itemprop="url" rel="index">
<span itemprop="name">WEB</span>
</a>
</span>
,
<span itemprop="about" itemscope itemtype="https://schema.org/Thing">
<a href="/categories/web/css/" itemprop="url" rel="index">
<span itemprop="name">CSS</span>
</a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<blockquote>
<p>本文根据MDN上的文章<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation" target="_blank" rel="external">animation - CSS | MDN</a>整理而成。</p>
</blockquote>
<h3 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h3><p>CSS的<code>animation</code>属性是一个简写的合集,包括的内容有:<code>animation-name</code>,<code>animation-duration</code>,<code>animation-timing-function</code>,<code>animation-delay</code>,<code>animation-iteration-count</code>,<code>animation-direction</code>,<code>animation-fill-mode</code>,<code>animation-play-state</code>。</p>
<p>CSS的animation属性可以应用于所有元素上,包括伪元素<code>::before</code>和<code>::after</code>。</p>
<h3 id="animation-name"><a href="#animation-name" class="headerlink" title="animation-name"></a>animation-name</h3><p>动画的名字,默认值为<code>none</code>。这个名字对应的帧动作将在<code>@keyframes</code>中进行定义。</p>
<h3 id="animation-duration"><a href="#animation-duration" class="headerlink" title="animation-duration"></a>animation-duration</h3><p>动画的持续时间,默认值为<code>0</code>。为<code>0</code>表示动画不会执行。非<code>0</code>值需要带单位,可以是秒<code>s</code>,也可以是毫秒<code>ms</code>。如果不给单位将视为一个无效值。</p>
<h3 id="animation-timing-function"><a href="#animation-timing-function" class="headerlink" title="animation-timing-function"></a>animation-timing-function</h3><p>动画的过度函数。</p>
<ul>
<li><code>linear</code>: 线性过渡。相当于贝塞尔曲线<code>(0.0, 0.0, 1.0, 1.0)</code></li><li><code>ease</code>: <strong>默认值</strong>。平滑过渡。相当于贝塞尔曲线<code>(0.25, 0.1, 0.25, 1.0)</code></li><li><code>ease-in</code>: 由慢到快。相当于贝塞尔曲线<code>(0.42, 0, 1.0, 1.0)</code></li><li><code>ease-out</code>: 由快到慢。相当于贝塞尔曲线<code>(0, 0, 0.58, 1.0)</code></li><li><code>ease-in-out</code>: 由慢到快再到慢。相当于贝塞尔曲线<code>(0.42, 0, 0.58, 1.0)</code></li><li><code>cubic-bezier(number, number, number, number)</code>: 特定的贝塞尔曲线类型,number 在 [0, 1] 区间内取值</li></ul>
<h3 id="animation-delay"><a href="#animation-delay" class="headerlink" title="animation-delay"></a>animation-delay</h3><p>动画初始的延迟时间,默认为<code>0</code>。为<code>0</code>时表示动画无延迟,立即执行。跟<code>duration</code>一样,非<code>0</code>值需要带单位。</p>
<p>可以设置为负值,设置负值时表示起始状态时动画已经执行了指定的时间。</p>
<h3 id="animation-iteration-count"><a href="#animation-iteration-count" class="headerlink" title="animation-iteration-count"></a>animation-iteration-count</h3><p>动画的循环次数,表示循环次数,默认为<code>1</code>。负值无效。<em>可以是小数,如设置为<code>2.5</code>,意味着动画执行两圈半。</em></p>
<p>设置为<code>infinite</code>表示无限循环。</p>
<h3 id="animation-direction"><a href="#animation-direction" class="headerlink" title="animation-direction"></a>animation-direction</h3><p>在循环中是否反向播放动画。<em>非循环动画该值无效。</em></p>
<ul>
<li><code>normal</code>,<strong>默认值</strong>。表示动画正方向正常播放。</li><li><code>reverse</code>,动画方向播放。</li><li><code>alternate</code>,每次循环后更换动画播放方向。即在奇数次时正向播放,在偶数次时反向播放。</li><li><code>alternate-reverse</code>,每次循环后更换动画播放方向,但第一次为反向。即动画在奇数次时反向播放,在偶数次时正向播放。</li></ul>
<h3 id="animation-fill-mode"><a href="#animation-fill-mode" class="headerlink" title="animation-fill-mode"></a>animation-fill-mode</h3><p><em>这是一个实验技术。</em></p>
<p>指定动画对象在动画执行之前或执行之后的样式状态。</p>
<ul>
<li><code>none</code>,<strong>默认值</strong>。不设置对象动画之外的状态</li><li><code>forwards</code>,设置对象状态为动画结束时的状态</li><li><code>backwards</code>,设置对象状态为动画开始时的状态</li><li><code>both</code>,设置对象状态为动画结束或开始的状态</li></ul>
<h3 id="animation-play-state"><a href="#animation-play-state" class="headerlink" title="animation-play-state"></a>animation-play-state</h3><p>表示动画的播放状态。</p>
<ul>
<li><code>running</code>,<strong>默认值</strong>。动画正在播放。</li><li><code>paused</code>,动画暂停。</li></ul>
<h3 id="keyframes"><a href="#keyframes" class="headerlink" title="@keyframes"></a>@keyframes</h3><p>动画帧的定义动作。</p>
<p>其语法简述为:</p>
<p><code>@keyframes identifier {selector {style;}}</code></p>
<ul>
<li><code>identifier</code>,动画的名称,对应于上面提到的<code>animation-name</code>。</li><li><code>selector</code>,动画持续时间的百分比。可以使用<code>from</code>来表示<code>0%</code>、<code>to</code>来表示<code>100%</code>。</li><li><code>style</code>,合理的CSS样式值,或者组合。</li></ul>
<blockquote>
<p><code>selector</code>可以使用多个进行组合,以逗号<code>,</code>分隔。<br>存在多个百分比一样的声明时,以最后一个为准,前面不论设置了什么都将被忽略<del>最新版规范没有对此进行说明,但有部分浏览器已经考虑对其实现了</del>。<br>使用<code>!important</code>声明样式时,该声明将被<strong>忽略</strong>。</p>
</blockquote>
<p>格式化语法:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">@keyframes <identifier> {</div><div class="line"> [ [ from | to | <percentage> ] [, from | to | <percentage> ]* block ]*</div><div class="line">}</div></pre></td></tr></table></figure>
<h3 id="兼容性"><a href="#兼容性" class="headerlink" title="兼容性"></a>兼容性</h3><p><code>animation</code>是CSS3中的新特性,浏览器对其的实现并不统一。具体兼容性情形请参阅<a href="http://caniuse.com/#feat=css-animation" target="_blank" rel="external">Can I use</a></p>
<p>添加浏览器的特定前缀可以使其达到兼容性要求。</p>
<ul>
<li>WebKit系浏览器前缀<code>-webkit-</code>,包括诸如Safari、Chrome等众多现代浏览器</li><li>Gecko系浏览器前缀<code>-moz-</code>,Firefox内核</li><li>Presto系浏览器前缀<code>-o-</code>,<strong>已废弃</strong>,Opera之前的内核。Opera内核现在已经转为<code>Blink</code>,该内核是WebKit系。</li><li>Trident系浏览器前缀<code>-ms-</code>,IE内核</li></ul>
<p>诸如<code>-khtml-</code>、<code>-icab-</code>诸君可自行搜索。</p>
<p>在上述提到的所有属性以及<code>@keyframes</code>,可<em>在有必要的情况下</em>添加对应浏览器的私有前缀以实现兼容。</p>
<h3 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">/* @keyframes duration | timing-function | delay | </div><div class="line"> iteration-count | direction | fill-mode | play-state | name */</div><div class="line"> animation: 3s ease-in 1s 2 reverse both paused slidein;</div><div class="line"></div><div class="line">/* @keyframes duration | timing-function | delay | name */</div><div class="line"> animation: 3s linear 1s slidein;</div><div class="line"></div><div class="line">/* @keyframes duration | name */</div><div class="line"> animation: 3s slidein;</div></pre></td></tr></table></figure>
<figure class="highlight css"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line"><span class="selector-tag">p</span> {</div><div class="line"> <span class="attribute">animation-duration</span>: <span class="number">3s</span>;</div><div class="line"> <span class="attribute">animation-name</span>: slidein;</div><div class="line">} </div><div class="line">@<span class="keyword">keyframes</span> slidein {</div><div class="line"> <span class="selector-tag">from</span> {</div><div class="line"> <span class="attribute">margin-left</span>: <span class="number">100%</span>;</div><div class="line"> <span class="attribute">width</span>: <span class="number">300%</span>; </div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="selector-tag">to</span> {</div><div class="line"> <span class="attribute">margin-left</span>: <span class="number">0%</span>;</div><div class="line"> <span class="attribute">width</span>: <span class="number">100%</span>;</div><div class="line"> }</div><div class="line">}</div></pre></td></tr></table></figure>
<blockquote>
<p>本人制作的一个错视动画:<a href="/garden/demo/animation-optical-illusion.html">错视动画演示</a></p>
</blockquote>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation" target="_blank" rel="external">animation - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes" target="_blank" rel="external">@keyframes - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name" target="_blank" rel="external">animation-name - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration" target="_blank" rel="external">animation-duration - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function" target="_blank" rel="external">animation-timing-function - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay" target="_blank" rel="external">animation-delay - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-iteration-count" target="_blank" rel="external">animation-iteration-count - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction" target="_blank" rel="external">animation-direction - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode" target="_blank" rel="external">animation-fill-mode - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state" target="_blank" rel="external">animation-play-state - CSS | MDN</a></li></ul>
<h3 id="扩展阅读"><a href="#扩展阅读" class="headerlink" title="扩展阅读"></a>扩展阅读</h3><ul>
<li><a href="https://drafts.csswg.org/css-animations/#animation" title="CSS动画草案" target="_blank" rel="external">CSS Animations Level 1</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation" target="_blank" rel="external">Using CSS animations - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties," title="可以使用动画的CSS属性" target="_blank" rel="external">CSS animated properties - CSS | MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent" title="动画事件" target="_blank" rel="external">AnimationEvent - Web APIs | MDN</a></li></ul>
<hr>
<p>全文完。</p>
</div>
<div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-tags">
<a href="/tags/frontend/" rel="tag">#前端</a>
<a href="/tags/css3/" rel="tag">#css3</a>
<a href="/tags/animation/" rel="tag">#animation</a>
</div>
<div class="post-nav">
<div class="post-nav-next post-nav-item">
<a href="/article/regexp-assertion.html" rel="next" title="正则表达式之零宽断言">
<i class="fa fa-chevron-left"></i> 正则表达式之零宽断言
</a>
</div>
<div class="post-nav-prev post-nav-item">
<a href="/article/a-responsive-menu.html" rel="prev" title="一个自适应菜单导航的设计实现过程">
一个自适应菜单导航的设计实现过程 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
</footer>
</article>
<div class="post-spread">
</div>
</div>
</div>
<div class="comments" id="comments">
<div class="ds-thread" data-thread-key="article/css-animation.html"
data-title="CSS - animation简介" data-url="http://xovel.cn/article/css-animation.html">
</div>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
文章目录
</li>
<li class="sidebar-nav-overview" data-target="site-overview">
站点概览
</li>
</ul>
<section class="site-overview sidebar-panel ">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image"
src="/images/xovel.jpg"
alt="xovel" />
<p class="site-author-name" itemprop="name">xovel</p>
<p class="site-description motion-element" itemprop="description">缓缓之间,风云静变</p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives">
<span class="site-state-item-count">46</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories">
<span class="site-state-item-count">15</span>
<span class="site-state-item-name">分类</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags">
<span class="site-state-item-count">117</span>
<span class="site-state-item-name">标签</span>
</a>
</div>
</nav>
<div class="feed-link motion-element">
<a href="/atom.xml" rel="alternate">
<i class="fa fa-rss"></i>
RSS
</a>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/xovel" target="_blank" title="github">
<i class="fa fa-fw fa-github"></i>
github
</a>
</span>
<span class="links-of-author-item">
<a href="http://hdk4.com" target="_blank" title="hdk4.com">
<i class="fa fa-fw fa-adjust"></i>
hdk4.com
</a>
</span>
</div>
<div class="cc-license motion-element" itemprop="license">
<a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank">
<img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
</a>
</div>
</section>
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
<div class="post-toc">
<div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#简介"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-name"><span class="nav-number">2.</span> <span class="nav-text">animation-name</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-duration"><span class="nav-number">3.</span> <span class="nav-text">animation-duration</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-timing-function"><span class="nav-number">4.</span> <span class="nav-text">animation-timing-function</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-delay"><span class="nav-number">5.</span> <span class="nav-text">animation-delay</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-iteration-count"><span class="nav-number">6.</span> <span class="nav-text">animation-iteration-count</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-direction"><span class="nav-number">7.</span> <span class="nav-text">animation-direction</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-fill-mode"><span class="nav-number">8.</span> <span class="nav-text">animation-fill-mode</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#animation-play-state"><span class="nav-number">9.</span> <span class="nav-text">animation-play-state</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#keyframes"><span class="nav-number">10.</span> <span class="nav-text">@keyframes</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#兼容性"><span class="nav-number">11.</span> <span class="nav-text">兼容性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#示例"><span class="nav-number">12.</span> <span class="nav-text">示例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考资料"><span class="nav-number">13.</span> <span class="nav-text">参考资料</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#扩展阅读"><span class="nav-number">14.</span> <span class="nav-text">扩展阅读</span></a></li></ol></div>
</div>
</section>
</div>
</aside>
</div>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright" >
©
<span itemprop="copyrightYear">2016</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">xovel</span>
</div>
<div class="powered-by">
由 <a class="theme-link" href="http://hexo.io" rel="external nofollow" target="_blank">Hexo</a> 强力驱动
</div>
<div class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next" rel="external nofollow" target="_blank">
NexT.Mist
</a>
</div>
</div>
</footer>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
</div>
</div>
<script type="text/javascript">
if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
window.Promise = null;
}
</script>
<script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
<script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>
<script type="text/javascript">
var duoshuoQuery = {short_name:"xovel"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.id = 'duoshuo-script';
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
</body>
</html>