A
A
Andrey2019-02-27 09:53:25
JavaScript
Andrey, 2019-02-27 09:53:25

Is transform not working in Velocity.js?

Good afternoon!
The other day I decided to master the Velocity.js library and while working I encountered the following problem, when calling velocity, when I set scale or translateY in the options, the velocity does not work, there are no errors in the console, although the velocity-animate class is added to the element. For other options, such as opacity, width, height, etc., everything works fine , the velocity works fine. I googled about this problem, they wrote that from the second version it is necessary to write the transform option like this: transform: 'scale(1.1)'. So I tried it, it also did not work in the console, and errors also appeared. I connected the velocity.min and velocity.ui.min libraries.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Bogdanov, 2019-02-28
@Andrey_Tech

Yes, the API changed in the second version, and the current doc on it is here https://github.com/julianshapiro/velocity/wiki
Therefore, instead of:

var option = {
   scale: 1.2
  };

Need to write:
var option = {
   transform: ["scale(1.2)", "scale(1)"]
  };

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question