Is it possible to rotate an element using a condition with out using Javascript.
I basically want the hand to start moving when one of my innerHTML elements reaches a certain length. Also is it possible to stop the hand at 180 degrees instead of it going back to its starting point.
Thanks :)
See code below:
.hand {
width: 20px;
height: 190px;
background-color: #005bdb;
position: absolute;
left: 0;
transform-origin: bottom;
-webkit-animation: spin 30s linear;
-moz-animation: spin 30s linear;
animation: spin 30s linear;
}
@-moz-keyframes spin {
100% {
-moz-transform: rotate(180deg);
}
}
@-webkit-keyframes spin {
100% {
-webkit-transform: rotate(180deg);
}
}
@keyframes spin {
100% {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
}
<div class="hand">
</div>