Get bounding box for SVG path using jQuery

前端 未结 5 1628
北荒
北荒 2020-12-16 17:22

I want to get the getBBox() for svg path in jquery. i tried like this

$(\"#\"+ path id)[0].getBBox() -> returns x=0,y=0,width=0,height=0

5条回答
  •  太阳男子
    2020-12-16 17:42

    One thing to make sure is that your svg is added to the DOM and not detached. Also make sure that your SVG element

提交回复
热议问题