значения свойства:
* {
margin
:
0
;
padding
}
.main {
height
600px
width
900px
position
absolute
top
50%
left
margin-top
-300px
margin-left
-450px
.wrapper {
33.3%
100%
float
#div
1
, #div
2
3
{
100px
relative
-50px
animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
animation-name: anim
-moz-animation-name: anim
-o-animation-name: anim
-webkit-animation-name: anim
animation-duration:
s;
-moz-animation-duration:
-o-animation-duration:
-webkit-animation-duration:
@keyframes anim
from {
background-color
#3BA9DE
to {
80px
-10px
#A3E61D
@-moz-keyframes anim
@-o-keyframes anim
@-webkit-keyframes anim
transform: scale(
1.8
,
);
-moz-transform: scale(
-o-transform: scale(
-webkit-transform: scale(
-ms-transform: scale(
#852E76
300px
520px
310px
* { margin: 0; padding: 0; } .main { height: 600px; width: 900px; position: absolute; top: 50%; left: 50%; margin-top: -300px; margin-left: -450px; } .wrapper { width: 33.3%; height: 100%; float: left; } #div1, #div2, #div3 { height: 100px; width: 100px; float: left; position: relative; top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite; } #div1 { animation-name: anim1; -moz-animation-name: anim1; -o-animation-name: anim1; -webkit-animation-name: anim1; animation-duration: 3s; -moz-animation-duration: 3s; -o-animation-duration: 3s; -webkit-animation-duration: 3s; } @keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; left: -10px; background-color: #A3E61D; } } @-moz-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; left: -10px; background-color: #A3E61D; } } @-o-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; left: -10px; background-color: #A3E61D; } } @-webkit-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; left: -10px; background-color: #A3E61D; } } #div2 { animation-name: anim2; -moz-animation-name: anim2; -o-animation-name: anim2; -webkit-animation-name: anim2; -moz-animation-duration: 3s; -o-animation-duration: 3s; -webkit-animation-duration: 3s; } @keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.8, 1.8); -moz-transform: scale(1.8, 1.8); -o-transform: scale(1.8, 1.8); -webkit-transform: scale(1.8, 1.8); -ms-transform: scale(1.8, 1.8); background-color: #852E76; } } @-moz-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.8, 1.8); -moz-transform: scale(1.8, 1.8); -o-transform: scale(1.8, 1.8); -webkit-transform: scale(1.8, 1.8); -ms-transform: scale(1.8, 1.8); background-color: #852E76; } } @-o-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.8, 1.8); -moz-transform: scale(1.8, 1.8); -o-transform: scale(1.8, 1.8); -webkit-transform: scale(1.8, 1.8); -ms-transform: scale(1.8, 1.8); background-color: #852E76; } } @-webkit-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.8, 1.8); -moz-transform: scale(1.8, 1.8); -o-transform: scale(1.8, 1.8); -webkit-transform: scale(1.8, 1.8); -ms-transform: scale(1.8, 1.8); background-color: #852E76; } } #div3 { animation-name: anim3; -moz-animation-name: anim3; -o-animation-name: anim3; -webkit-animation-name: anim3; } @keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; left: 310px; background-color: #A3E61D; } } @-moz-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; left: 310px; background-color: #A3E61D; } } @-o-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; left: 310px; background-color: #A3E61D; } } @-webkit-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; left: 310px; background-color: #A3E61D; } }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
type
"text/javascript"
src
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></
</
body
div
class
"main"
"wrapper"
id
"div1"
"div2"
"div3"
/*JavaScript*/
document.getElementById("div2").style.animationDuration="3s";
document.getElementById("div2").style.msAnimationDuration="3s";
/*jQuery*/
$(document).ready(function() {
$("#div3").css({ "animation-duration": "3s" });
$("#div3").css({ "-moz-animation-duration": "3s" });
$("#div3").css({ "-o-animation-duration": "3s" });
$("#div3").css({ "-webkit-animation-duration": "3s" });
});