【问题标题】:Internet Explorer CSS rotation wobbleInternet Explorer CSS 旋转摆动
【发布时间】:2016-06-14 23:46:46
【问题描述】:

我有一个 SVG 元素,里面有一个圆圈。 SVG 正在使用关键帧动画无限旋转:

@keyframes rotate {
  0%       { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  100%     { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

svg{
  width: 500px;
  height: 500px;
  display: block;
  animation: rotate 2.9s linear infinite;
  transform-origin: center;
}

我的问题是,在 Internet Explorer 11 上,旋转似乎在旋转时会轻微摇晃(所有其他浏览器的行为都符合预期)。尝试关注黑框的顶部或左侧边缘。

有什么办法可以避免这种情况吗?

Here's a fiddle with the test scenario.

下面是一个展示它的 gif:

【问题讨论】:

    标签: css internet-explorer svg css-animations css-transforms


    【解决方案1】:

    如果有人想知道,以下是我设法解决此问题的方法:SVG 的 transform-origin 应设置为圆的半径(在本例中为 250 像素)所有维度(x,y和 z)。

    svg{
      /* other styles go here */
      transform-origin: 250px 250px 250px;
    }
    

    【讨论】:

    猜你喜欢
    • 2017-08-09
    • 2015-12-02
    • 2018-04-15
    • 1970-01-01
    • 2011-09-10
    • 2019-01-12
    • 2015-02-28
    • 2019-02-16
    • 1970-01-01
    相关资源
    最近更新 更多