File tree Expand file tree Collapse file tree 1 file changed +22
-20
lines changed
animation-frames-timing-function Expand file tree Collapse file tree 1 file changed +22
-20
lines changed Original file line number Diff line number Diff line change 1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
< html lang ="en-us ">
3
3
< head >
4
4
< meta charset ="utf-8 " />
23
23
left : 10px ;
24
24
color : white;
25
25
}
26
-
27
26
</ style >
28
27
</ head >
29
28
< body >
30
- < div class ="div1 "> < p > transition-timing-function: frames(10)< p > </ div >
31
- < div class ="div2 "> < p > transition-timing-function: steps(10);< p > </ div >
32
- < div class ="div3 "> < p > transition-timing-function: ease-in;< p > </ div >
29
+ < div class ="div1 ">
30
+ < p > transition-timing-function: steps(5)</ p >
31
+ < p > </ p >
32
+ </ div >
33
+ < div class ="div2 ">
34
+ < p > transition-timing-function: steps(10);</ p >
35
+ < p > </ p >
36
+ </ div >
37
+ < div class ="div3 ">
38
+ < p > transition-timing-function: ease-in;</ p >
39
+ < p > </ p >
40
+ </ div >
33
41
34
42
< script >
35
-
36
- var easingFunctions = [
37
- 'frames(10)' ,
38
- 'steps(10)' ,
39
- 'ease-in'
40
- ]
43
+ var easingFunctions = [ "steps(5)" , "steps(10)" , "ease-in" ] ;
41
44
42
45
var keyFrames = [
43
- { width : '0%' , background : ' red' } ,
44
- { width : ' 100%' , background : ' blue' } ,
45
- ]
46
+ { width : "0%" , background : " red" } ,
47
+ { width : " 100%" , background : " blue" } ,
48
+ ] ;
46
49
47
- var divs = document . querySelectorAll ( ' div' ) ;
50
+ var divs = document . querySelectorAll ( " div" ) ;
48
51
49
- for ( var i = 0 ; i < divs . length ; i ++ ) {
52
+ for ( var i = 0 ; i < divs . length ; i ++ ) {
50
53
divs [ i ] . animate ( keyFrames , {
51
- easing : easingFunctions [ i ] ,
52
- duration : 5000 ,
53
- iterations : Infinity
54
+ easing : easingFunctions [ i ] ,
55
+ duration : 5000 ,
56
+ iterations : Infinity ,
54
57
} ) ;
55
58
}
56
-
57
59
</ script >
58
60
</ body >
59
61
</ html >
You can’t perform that action at this time.
0 commit comments