I use Velocity.js for animation.
I am the first translation and rotation of the object. After the animation is complete, I need to rotate the object 360 degrees.
The problem is that during the second animation, the rotation axis is turned off. Instead of turning around the center, the object rotates around its starting point.
$.Velocity( obj, "stop" );
$.Velocity( obj,
{translateX: pos, rotateZ: rotation + 'deg'},
{duration: 1000, complete: function() {
$.Velocity( obj, {rotateZ: "360deg"}, {duration: 1000} ); }
});
What could be the problem?
UPDATE
Codepen that demonstrates the problem: http://codepen.io/anon/pen/MYZaaj
source
share