我想用jQuery摆动一个图像。我已经读过这么多教程了,但我无法找到如何做到这一点。
发布于 2015-04-10 03:27:54
您也可以使用CSS:http://jsfiddle.net/gVCWE/1193/来完成它。
bod{
background:blue;
}
.box{
width:50px; height:50px;
background: yellow;
border: 1px solid black;
margin:100px;
position: relative;
float: left;
-moz-animation: 3s ease 0s normal none infinite swing;
-moz-transform-origin: center top;
-webkit-animation:swing 3s infinite ease-in-out;
-webkit-transform-origin:top;
}
@-moz-keyframes swing{
0%{-moz-transform:rotate(-500deg)}
50%{-moz-transform:rotate(500deg)}
100%{-moz-transform:rotate(-500deg)}
}
@-webkit-keyframes swing{
0%{-webkit-transform:rotate(-500deg)}
50%{-webkit-transform:rotate(500deg)}
100%{-webkit-transform:rotate(-500deg)}
}
希望能帮上忙。
https://stackoverflow.com/questions/29557198
复制相似问题