F
F
Fredd Monty2016-03-28 23:21:46
css
Fredd Monty, 2016-03-28 23:21:46

Smooth rotation of an object around a fixed point?

Hello everyone,
there is a switch that points to the active area.
tell me how to smoothly move the arrow from the current position
b08f9d1d17f441c0a2f71edaef42fc27.png
to the far right.
b3a13dab36db4ae790a78285d6375c19.png
By means of CSS.
Maybe someone came across.
It turns out that the upper part should not be movable, I haven’t succeeded so far, and during the transition it twitches up, and then it becomes as it should be to the right edge :( I
e257fcbe87224e52830bd22242d42d69.png
move it with this code:
.scale-arrow {
position: absolute;
top: 22px ;
left: 10%;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-transform: rotate(-29deg);
transform: rotate(-29deg);
}
.scale-arrow.active {
top: 22px;
left: 38%
-webkit-transform: rotate(-147deg);
transform: rotate(-147deg);
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
Tell me what to use, what to look for in order to move the object around a fixed point.
Thanks to all!
Have a nice day!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Igorevich, 2016-03-28
@ferds

transform-origin: <x>, <y>, <z>
codepen.io/pena/pen/jqwjjq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question