2012-03-18 29 views

回答

2

隨着越來越多的搜索,我發現了一些JavaScript方法應該做的工作:

getTotalLength()

document.getElementById("segment-line-c2200").getTotalLength()

回報205.11094665527344

getBBox()

document.getElementById("segment-line-c2200").getBBox()

回報

SVGRect 
    height: 32.8560791015625 
    width: 202.4622802734375 
    x: 1617.7255859375 
    y: 2013.96435546875 
    __proto__: SVGRect