css - CSS3 Rotate from 0 to 90 then 90 to 180 -


i have object rotating 360 degrees using css3's rotate animation. however, code (linked below) rotates image 360 degrees repeats same animation.

i want rotate 360 degrees, pause every 90 degress , have infinite rotating.

any appreciated.

thanks

.image { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin:-60px 0 0 -60px; -webkit-animation:spin 1s ease-in-out infinite; -moz-animation:spin 1s linear infinite; animation:spin 1s linear infinite; } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } 

here jsfiddle project

you need add additional points in keyframe:

fiddle

@-webkit-keyframes rotate {   0% { -webkit-transform: rotate(0deg); }   20% { -webkit-transform: rotate(90deg); }   25% { -webkit-transform: rotate(90deg); }   45% { -webkit-transform: rotate(180deg); }   50% { -webkit-transform: rotate(180deg); }   70% { -webkit-transform: rotate(270deg); }   75% { -webkit-transform: rotate(270deg); }   100% { -webkit-transform: rotate(360deg); } }  .animation-rotate {     -webkit-animation-name: rotate;      -webkit-animation-duration: 4.5s;      -webkit-animation-iteration-count: infinite;     -webkit-transition-timing-function: linear; } 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -