Tuesday, March 24, 2009

Finding Eventtop and EventLeft position Using javascript

var evnt=window.event;
var y =evnt.clientY + document.body.scrollTop + document.body.parentNode.scrollTop;
var x =evnt.clientX + document.body.scrollLeft + document.body.parentNode.scrollLeft;

You have to apply this top and left position value to style attribute of the control.