offsetTop :当前对象到其上级层顶部的距离.
offsetLeft :当前对象到其上级层左边的距离.
比如:
父div的四个点的位置是(0,0),(0,width1),(height1,0),(height1,width1)
而子div的四个点的位置是(offsetTop,offsetLeft),(offsetTop ,offsetLeft+width2),(offsetTop+height2,offsetLeft),(offsetTop+height2,offsetLeft+width2)
然后对比这些点的位置即可