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);
}
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);}
}
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);}
}
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);}
}
Combing Elements