JS Добавить маржу с переменной
document.getElementsByClassName('player')[0].style.marginTop = playerPosition+"px";
DevLorenzo
document.getElementsByClassName('player')[0].style.marginTop = playerPosition+"px";
var players = document.getElementsByClassName('player');
for(var i = 0; i < players.length; i++)
players[i].style.marginTop = playerPosition+"px";