SVG use tag with external reference in IE 11

后端 未结 2 730
不知归路
不知归路 2020-12-31 09:28

I want to include an inline svg in an html5 page that includes \"use\" tags that reference elements in a different svg file, referenced by URL. This is part of the SVG spec

2条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 10:00

    svg4everybody uses requestAnimationFrame, which causes too many calls. I wrote a simple and lighweight polyfill for the very purpose of supporting elements with external references when the browser itself fails. This polyfill uses feature detection rather than browser sniffing. It's on github: https://github.com/Keyamoon/svgxuse

    Live demo: https://icomoon.io/svgxuse-demo

提交回复
热议问题