Reputation: 1924
Hello everyone,
I'm having a little hard time figuring out why the JS on the codepen won't work. Applying element.style.transform
directly works perfectly, however when applied via mousemove
nothing happens.
Modifying transform
for any other css property works as expected. I've also tested webkitTransform
on chrome to no avail.
Thanks!
Upvotes: 0
Views: 32
Reputation: 18099
Well, a semi-colon prevented that and troubled you! Remove semi-colon from the template:
let transform = `rotateX(${degs.x}deg) rotateY(${degs.y}deg) perspective(1000px) scale3d(1.06, 1.06, 1.06)`;
Demo: https://codepen.io/anon/pen/XqvjYG
Upvotes: 2