function moveLeft(obj){
obj.style.left = parseInt(obj.style.left) - 0.5 + "%";
}
function moveRight(obj){
obj.style.left = parseInt(obj.style.left) + 0.5 + "%";
}
The code here is supposed to move my image object to the left and to the right by updating percentages instead of pixels. moveLeft works but moveRight doesn't. Is it something to do with associativity?