Microsoft AJAX Library provides a bunch of facilities to manipulate the HTML element on client side, including getting and setting the position of an element.
For example:
To get a Panel's current position on the client side, we can use $common.getLocation(DOM Element) function.
For example:
To get a Panel's current position on the client side, we can use $common.getLocation(DOM Element) function.
To set its position://Get DOM Element with $get() function. var el = $get('<%=Panel1.ClientID%>'); //Get its position. var newLocation = $common.getLocation(el);
//Create the new position. var newLocation = new Sys.UI.Point(x-position,y-position); //Move the Panel to the destination. $common.setLocation(Panel, newLocation);
Sometimes,