How To Animate Translate Properties With Velocity.js?
Solution 1:
In Velocity V2 there are no longer any transform
shortcuts such as translateX - just use the css transform
property properly and it'll work (there are issues in V1 with trying to do that unfortunately).
Velocity(adiv, {transform:"translateX(200px)"}, [ 500, 20 ]);
If there's no forcefeeding it'll animate from a value of 0.
Solution 2:
Velocity seems to be picking up steam with version 3 of VUE coming up. I highly suggest the Velocity 2.0 docs to be a little more updated with information such as:
In Velocity V2 there are no longer any transform shortcuts such as translateX - just use the css transform property properly and it'll work (there are issues in V1 with trying to do that unfortunately). Velocity(adiv, {transform:"translateX(200px)"}, [ 500, 20 ]);
Or reach out to the VUE team as they are still using the Velocity 1.x examples.
Solution 3:
Easy example with jQuery:
$('.box').on('click', function() {
$(this).velocity({
transform: ["translateX(100px)", "translateX(0px)"]
}, {duration: 1000});
});
Post a Comment for "How To Animate Translate Properties With Velocity.js?"