Obtaining an original SVG viewBox via javascript

后端 未结 4 1767
南笙
南笙 2021-01-07 17:53

Our system loads SVG files programmatically into HTML via AJAX. A typical SVG file begins with:

 

        
4条回答
  •  生来不讨喜
    2021-01-07 18:28

    Even easier, put an id in your svg then :

    document.getElementById("your_id").getAttribute("viewBox");
    

提交回复
热议问题