【问题标题】:Issue with SVG in IE9IE9 中的 SVG 问题
【发布时间】:2014-06-14 08:09:59
【问题描述】:

我有这个滑块:

http://ftp.escape.pe/slider/

它在所有浏览器中都可以正常工作,除了 IE9(在 IE8 中也可以)。 我在我的 html 代码中使用 SVG。

请问,谁能帮帮我? 谢谢!

【问题讨论】:

    标签: javascript svg internet-explorer-9


    【解决方案1】:

    似乎foreignObject 在IE9 中被破坏了。看到这里有同样问题的另一个人:

    alternative to foreignObject for IE9

    你为什么还要使用foreignObject?

    <svg>
       <foreignObject style="mask: url(#mask);" height="185px" width="250px">        
          <img src="http://patrickkirkby.com/files/images/gallery/thumb_001.jpg">
       </foreignObject>
    </svg>
    

    应该可以替换为:

    <svg xmlns:xlink="http://www.w3.org/1999/xlink">
       <image xlink:href="http://patrickkirkby.com/files/images/gallery/thumb_001.jpg"
              style="mask: url(#mask)" height="185px" width="250px">
    </svg>
    

    这应该在 IE 中工作。

    【讨论】:

      猜你喜欢
      • 2013-12-31
      • 2011-09-28
      • 2014-07-08
      • 1970-01-01
      • 2011-09-13
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      相关资源
      最近更新 更多