Ver originalsetInterval(function(){ var div=document.querySelector('div'); var pixels=div.style.left.substring(0,div.style.left.length-2)*1; div.style.left=(pixels+5)+'px'; },50);