﻿function GetElementX(ob)//得到元素的X位置
{
var x=ob.offsetLeft;
    while(ob=ob.offsetParent)
    {
        x+=ob.offsetLeft;
    }
    return x;
}
function GetElementY(ob) //得到元素的Y位置
{
    var y=ob.offsetTop;
    while(ob=ob.offsetParent)
    {
        y+=ob.offsetTop;
    }
    return y;
}
