Kumu
Crafting Wizard
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
In this article, we are going tackled about Animation Iteration Count in CSS. What is animation-iteration-count?
Let's discuss a animation-iteration-count.
The animation-iteration-count property specifies how many times an animation should be played.
Syntax of this property:
animation-iteration-count: number | infinite | initial | inherit ;
Property Values
number - it specifies a number that defines how many times an animation should be played. (default = 1)
infinite - it specifies that the animation should be played infinite times.
initial - it specifies that the value of the property should be set to the default value.
inherit - it specifies that the value of the property should be inherited from the parent element.
Example
This example shows how many times an animation should be played.
Copy and paste this source code to your HEAD tag of your page.
Copy and paste this source code to your BODY tag of your page.
This is the result of the code above:
Kindly click the "Download Code" button below for full source code. Thank you very much.
So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
Let's discuss a animation-iteration-count.
The animation-iteration-count property specifies how many times an animation should be played.
Syntax of this property:
animation-iteration-count: number | infinite | initial | inherit ;
Property Values
number - it specifies a number that defines how many times an animation should be played. (default = 1)
infinite - it specifies that the animation should be played infinite times.
initial - it specifies that the value of the property should be set to the default value.
inherit - it specifies that the value of the property should be inherited from the parent element.
Example
This example shows how many times an animation should be played.
Copy and paste this source code to your HEAD tag of your page.
- <style type=
"text/css"
>
- div.animate
{
- width
:
50px
;
- height
:
50px
;
- color
:
white
;
- padding
:
2px
;
- background
:
blue
;
- position
:
relative
;
- }
- #test1
{
- animation-name
:
boxmove;
- animation-duration
:
5s
;
- animation-iteration-count
:
infinite
;
- /* Firefox */
- -moz-animation-name:
boxmove;
- -moz-animation-duration:
5s
;
- -moz-animation-iteration-count:
infinite
;
- /* Safari and Google Chrome */
- -webkit-animation-name:
boxmove;
- -webkit-animation-duration:
5s
;
- -webkit-animation-iteration-count:
infinite
;
- }
- #test2
{
- animation-name
:
boxmove;
- animation-duration
:
5s
;
- animation-iteration-count
:
5
;
- /* Firefox */
- -moz-animation-name:
boxmove;
- -moz-animation-duration:
5s
;
- -moz-animation-iteration-count:
5
;
- /* Safari and Google Chrome */
- -webkit-animation-name:
boxmove;
- -webkit-animation-duration:
5s
;
- -webkit-animation-iteration-count:
5
;
- }
- #test3
{
- animation-name
:
boxmove;
- animation-duration
:
5s
;
- animation-iteration-count
:
3
;
- /* Firefox */
- -moz-animation-name:
boxmove;
- -moz-animation-duration:
5s
;
- -moz-animation-iteration-count:
3
;
- /* Safari and Google Chrome */
- -webkit-animation-name:
boxmove;
- -webkit-animation-duration:
5s
;
- -webkit-animation-iteration-count:
3
;
- }
- @keyframes
boxmove
- {
- from {
left
:
0px
;
}
- to {
left
:
210px
;
}
- }
- @-moz-keyframes
boxmove /* Firefox */
- {
- from {
left
:
0px
;
}
- to {
left
:
210px
;
}
- }
- @-webkit-keyframes
boxmove /* Safari and Google Chrome */
- {
- from {
left
:
0px
;
}
- to {
left
:
210px
;
}
- }
- </style>
Copy and paste this source code to your BODY tag of your page.
- <div
id
=
"test1"
class
=
"animate"
>
infinite</
div
>
- <br
/
>
- <div
id
=
"test2"
class
=
"animate"
>
5 times</
div
>
- <br
/
>
- <div
id
=
"test3"
class
=
"animate"
>
3 times</
div
>
This is the result of the code above:

Kindly click the "Download Code" button below for full source code. Thank you very much.
So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
You must upgrade your account or reply in the thread to view hidden text.