How to change a few css styles to several elements at the same event?

There are 4 elements, located in different areas of the page. Want that they are "following" the cursor position, and they've changed the transform property: translate (), rotate(), more styles until you tell me, because I want to experiment.

The catch happened at a time when I wrote a simple script for a similar task, but there the goal was to create a parallax effect with side-shift depending on the position of the mouse.

window.onmousemove = function() {
 var mouseY = event.clientY;
 var mouseX = event.clientX;
 document.getElementById('header').style.transform = "translate(" + (mouseX / 6) + "px" + (mouseY / 6) + "px)"; 
 console.log(mouseY + " - " + mouseX);
}


Log console said that the two variables work fine, but nevertheless, change occurred only along one axis. So I decided that this is a feature of the script. Maybe just a syntax error? I really do not see the emphasis, if any. :\
March 12th 20 at 08:12
1 answer
March 12th 20 at 08:14
Solution
Maybe just a syntax error? I really do not see the emphasis, if any. :\

Of course, it is. You missed the comma in the parameters of the function translate().

Find more questions by tags JavaScriptCSS