As shown below:
//Return array type
function findPosition(oElement) {//oElement current element
if (typeof (oElement.offsetParent) != 'undefined') {
for (var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
posX = oElement.offsetLeft;
posY = oElement.offsetTop;
}
}
var array = [posX, posY];
return array;
// Get the absolute X coordinate of the control that triggered the event in the entire page
function findPositionX(oElement) {
var posX = 0; oElement; oElement = oElement.offsetParent)
}
return posX; The absolute Y coordinate of the control that triggered the event on the entire page
function findPositionY(oElement) {
if (typeof (oElement.offsetParent) != 'undefined') {
for (var posY = 0; oElement ; oElement = oElement.offsetParent) {
}