Get Left Position of Control

Posted by Lakhangarg under JavaScript category on | Views : 3672
JavaScript function to Get the Left Position of any control.
Pass the control ID for which you want to calculate the left position.

function LeftPos(ctrlID, pos)
var leftCoord = 0;
leftCoord += ctrlID.offsetLeft;
ctrlID= ctrlID.offsetParent;
return leftCoord + pos;

Thanks & Regards
Lakhan Pal Garg

Comments or Responses

Login to post response