Angular movement occurs
-when the y ordinate varies -and the x ordinate varies independent of the y ordinate
-The direction is Southeast when the y and x ordinates are positive
-The direction is Northwest when the y and x ordinates are negative
-The direction is Southwest when the y ordinate is positive and x ordinate. is negative
-The direction is Northeast when the y ordinate is negative and x ordinate is positive
prof
prof
prof
prof
Southeast
function movet6(){
var step=2;
var x=document.getElementById('profr').offsetLeft;
var y=document.getElementById('profr').offsetTop;
if(y < 450 )
{y= y +step;x=x +3;
document.getElementById('profr').style.left= x + "px";
document.getElementById('profr').style.top= y + "px";
setTimeout('movet6()',50);}
}
Northwest
function movet9(){
var step=-2;
var x=document.getElementById('profl').offsetLeft;
var y=document.getElementById('profl').offsetTop;
if(y > 50 )
{y= y +step;x=x -3;
document.getElementById('profl').style.left= x + "px";
document.getElementById('profl').style.top= y + "px";
setTimeout('movet9()',50);}
}
Northeast
function movet3(){
var step=-2;
var x=document.getElementById('profbl').offsetLeft;
var y=document.getElementById('profbl').offsetTop;
if(y > 50 )
{y= y +step;x=x +3;
document.getElementById('profbl').style.left= x + "px";
document.getElementById('profbl').style.top= y + "px";
setTimeout('movet3()',50);}
}
Southwest
function movet1(){
var step=2;
var x=document.getElementById('proftr').offsetLeft;
var y=document.getElementById('proftr').offsetTop;
if(y < 450 )
{y= y +step;x=x -3;
document.getElementById('proftr').style.left= x + "px";
document.getElementById('proftr').style.top= y + "px";
setTimeout('movet1()',50);}
}