CSS tranform:translateY from JavaScript

You can pass any transform property as a string.

HOW?

It can be done like this;

div.style.transform = "translate(x,y)"

I find out that if I write

div.style.transform = "translate(someValue)"

It only affects x axes.

"translate-y(someValue)" or "translate-x(someValue)"

did not work out.

Or you can use rotate property;

div.style.transform = "rotate(50px)".

Try it!

https://jsfiddle.net/araknafobia/4wtxu0dr/1/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)