位置:电子教程 > CSS3教程 (如果看不到内容请使用360浏览器) 推荐学习资源
CSS3基础样式
CSS3 高级样式
当前阅读教程:CSS3教程 > animation-iteration-count 属性
阅读(22555525)      收藏       赞(5685)      分享
上一篇: animation-delay 属性 下一篇: animation-direction 属性

浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号。

紧跟在 -webkit-, -ms- -moz- 前的数字为支持该前缀属性的第一个浏览器版本号。

image.png

标签定义及使用说明

animation-iteration-count属性定义动画应该播放多少次。

默认值:

1

继承:

no

版本:

CSS3

JavaScript 语法:

object   object.style.animationIterationCount=3

 

语法

animation-iteration-count: value;

 

描述

n

一个数字,定义应该播放多少次动画

infinite

指定动画应该播放无限次(永远)

 

实例

播放三次动画

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>animation-iteration-count 属性</title>
<!--定义内部样式-->
<style>
     div
     {
             width:100px;
             height:100px;
             background:red;
             position:relative;
             animation:mymove 3s;
             animation-iteration-count:3;/*播放三次动画*/
 
             /* Safari and Chrome */
             -webkit-animation:mymove 3s;
             -webkit-animation-iteration-count:3;
     }
 
     @keyframes mymove
     {
             from {top:0px;}
             to {top:200px;}
     }
 
     @-webkit-keyframes mymove /* Safari and Chrome */
     {
             from {top:0px;}
             to {top:200px;}
     }
</style>
</head>
<body>
 
     <p><strong>注意:</strong> Internet Explorer 9 及更早 IE 版本浏览器不支持 animation-iteration-count 属性。</p>
     <div></div>
 
</body>
</html>




上一篇: animation-delay 属性 下一篇: animation-direction 属性
计算机毕业设计作品网      毕业设计文档网      小程序教程网       毕业设计资料网  |         毕业设计定制QQ:45157718(微信同号)(备注:毕设)