5
我使用这个CSS代码,我发现小提琴旋转我的车轮:CSS旋转轮5秒后停止?
http://jsfiddle.net/gaby/9Ryvs/7/
div {
margin: 20px;
width: 100px;
height: 100px;
background: #f00;
-webkit-animation-name: spin;
-webkit-animation-duration: 4000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: spin;
-moz-animation-duration: 4000ms;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: spin;
-ms-animation-duration: 4000ms;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
animation-name: spin;
animation-duration: 4000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
基本上我想阻止它达到1800个辈分正好经过纺纱,然后回到0,所以我可以稍后再旋转它。
这可能吗?
更新了你的jsFiddle,在Chrome中对我很好。 – PlantTheIdea
每360度旋转555ms运行(不确定,请参阅小提琴或代码)。在代码上,它是4000ms,但将其更改为555ms。我想让JavaScript超时,所以它会将img更改为不移动的。总共多少毫秒? (555 * 4)是否正确? –
当我在Chrome上运行它时,每次旋转都是4s(4000ms)长。如果你想要所有的5次旋转总共发生4000ms,那么做800ms(4000/5)。 – PlantTheIdea