for (var i = 0; i < items.length; i++) {
//items[i].style.left = items[i].basicLeft + 100 * phase[i] + 'px';
//console.log(items[i].style.left);
var translation=items[i].basicLeft + 100 * phase[i] + 'px';
console.log(translation);
items[i].style.transform = 'translateX(translation)';
}
Here the translateX
is not updating I tried using constants in place of variable as an argument to translateX
but there are no changes.
console.log
for translation gives expected values.
If I use style.left
the code which I have commented above the code works fine.