reset">
Lateral movement occurs
when the x ordinate varies and the y ordinate remains constant
Vertical movement occurs
when the y ordinate varies and the x ordinate remains constant
prof
Move Right
function move1(){
var step=2;
var x=document.getElementById('profr').offsetLeft;
if(x < 400 )
{x= x +step;
document.getElementById('profr').style.left= x + "px";
setTimeout('move1()',10};
}
prof
Move Left
function move3(){
var step=-2;
var x=document.getElementById('profl').offsetLeft;
if(x > 400 )
{x= x +step;
document.getElementById('profl').style.left= x + "px";
setTimeout('move3()',10);}
}
prof
Move Down
function move5(){
var step=2;
var y=document.getElementById('profd').offsetTop;
if(y < 400 )
{y= y +step;
document.getElementById('profd').style.top= y + "px";
setTimeout('move5()',10);}
}
prof
Move Up
function move7(){
var step=-2;
var y=document.getElementById('profu').offsetTop;
if(y > 50 )
{y= y +step;
document.getElementById('profu').style.top= y + "px";
setTimeout('move7()',10);}
}
worm
combine
home Valid CSS! HTML Hit Counter