Ciao,
per
op:862, left:10 e arriva a top:0,bottom:screen.width
intendevi
op:862, left:10 e arriva a top:0,
left:screen.width
Se è si, la funzione dovrebbe essere:
codice:
function moveImage(img){
var step=1;
var sw = screen.width; //non sono sicuro che si recuperi così, controlla meglio.
var top;
var left = parseInt(substr(img.style.left, img.style.left.length-2)); //tolgo il 'px' dall'attributo left.
left+= step;
top = (left*(sw-862) -10*sw)/-10;
img.style.left = left + 'px';
img.style.top = top + 'px';
return null;
}
l'ho buttata giù senza testarla, potrebbero esserci degli errori di sintassi.