The rotation eases in and out even though I don’t specify the out parameter. How can I make it stay at 360 or just go back to 0 without any animation?
div {
position: absolute;
left: 100px;
top: 100px;
width: 100px;
height: 100px;
background-color: blue;
-webkit-transition:-webkit-transform 0.5s ease-in;
}
div:hover {
-webkit-transform:rotate(360deg);
}
I don’t believe it’s possible to set the timing on the “out” differently than the “in”. The
ease-inoption is the timing function. Other options aredefault,linear,ease-out,ease-in-out, andcubic-bezier. You can read more about them here, but there isn’t any information on setting the transition-out to zero seconds, unfortunately.An alternate option might be to use JS to get the functionality you want and still use the CSS animation: