Finding Offset Position of SVG Element

后端 未结 3 2167
栀梦
栀梦 2020-12-29 23:22

I\'ve run into this problem a lot with D3. A lot of the time I like to overlay HTML objects over my SVG.

My current strategy is creating an empty DIV next to the SV

3条回答
  •  佛祖请我去吃肉
    2020-12-29 23:47

    did you try

    var xywh =element[0][0].getBoundingClientRect();
    

    seems to have everything in it? (original soution is in this post)

提交回复
热议问题