raazer
Guild Coordinator
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
CSS animation-play-state
In this tutorial we are going to learn about animation-play-state. So, what is animation-play-state?
The animation-play-state property specifies whether the animation is paused or running.
Syntax of this property:
animation-play-state
:
paused | running | initial
| inherit
;
Property Values
Example
This example shows the use of the animation-play-state property.
CSS Style
The Complete Source Code
This is the result of the code above:
Hope that this tutorial will help you a lot.
If you are interested in programming, we have an example of programs that may help you even just in small ways. If you want more tutorials, you can visit our website, click here.
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
In this tutorial we are going to learn about animation-play-state. So, what is animation-play-state?
The animation-play-state property specifies whether the animation is paused or running.
Syntax of this property:
animation-play-state
:
paused | running | initial
| inherit
;
Property Values
- paused - specifies that the animation is paused.
- running - specifies that the animation is running. The default value is running.
- initial - specifies that the value of the property should be set to the default value.
- inherit - specifies that the value of the property should be inherited from the parent element.
Example
This example shows the use of the animation-play-state property.
CSS Style
- <style type=
"text/css"
>
- div.animate
{
- width
:
50px
;
- height
:
50px
;
- color
:
white
;
- padding
:
2px
;
- background
:
blue
;
- position
:
relative
;
- animation
:
boxmove 5s
infinite
;
- /* Firefox */
- -moz-animation:
boxmove 5s
infinite
;
- /* Safari and Google Chrome */
- -webkit-animation:
boxmove 5s
infinite
;
- }
- #test1
{
- animation-play-state
:
running;
- /* Firefox */
- -moz-animation-play-state:
running;
- /* Safari and Google Chrome */
- -webkit-animation-play-state:
running;
- }
- #test2
{
- animation-play-state
:
paused;
- /* Firefox */
- -moz-animation-play-state:
paused;
- /* Safari and Google Chrome */
- -webkit-animation-play-state:
paused;
- }
- @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>
The Complete Source Code
- <!DOCTYPE html>
- <html
>
- <head
>
- <style
type
=
"text/css"
>
- div.animate {
- width:50px;
- height:50px;
- color:white;
- padding:2px;
- background:blue;
- position:relative;
- animation:boxmove 5s infinite;
- /* Firefox */
- -moz-animation:boxmove 5s infinite;
- /* Safari and Google Chrome */
- -webkit-animation:boxmove 5s infinite;
- }
- #test1 {
- animation-play-state:running;
- /* Firefox */
- -moz-animation-play-state:running;
- /* Safari and Google Chrome */
- -webkit-animation-play-state:running;
- }
- #test2 {
- animation-play-state:paused;
- /* Firefox */
- -moz-animation-play-state:paused;
- /* Safari and Google Chrome */
- -webkit-animation-play-state:paused;
- }
- @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
>
- </
head
>
- <body
>
- <div
id
=
"test1"
class
=
"animate"
>
running</
div
>
- <br
/
>
- <div
id
=
"test2"
class
=
"animate"
>
paused</
div
>
- </
body
>
- </
html
>
This is the result of the code above:

Hope that this tutorial will help you a lot.
If you are interested in programming, we have an example of programs that may help you even just in small ways. If you want more tutorials, you can visit our website, click here.
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 the hidden content.