getting the X and Y coordinates for a div element

前端 未结 5 1823
故里飘歌
故里飘歌 2020-12-17 14:55

I\'ve been trying to make a javascript to get a X and Y coordinates of a div element. After some trying around I have come up with some numbers but I\'m not sur

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 15:50

    You need to find the position using the parent's position too. There's a very good tutorial here: http://www.quirksmode.org/js/findpos.html

提交回复
热议问题