【问题标题】:Internet Explorer 11 wobbly CSS3 animationInternet Explorer 11 不稳定的 CSS3 动画
【发布时间】:2014-05-12 17:31:24
【问题描述】:

请参考这个小提琴:http://jsfiddle.net/eQegA/3/

<div class="spinner"></div>

.spinner {
    width: 100px;
    height: 100px;
    border: 50px solid blue;
    /*border-top-color: #fff;
    border-bottom-color: #fff;*/ /* commented out to see the wobble better */
    border-radius: 200px;    

    -webkit-animation: application-loading-rotate 1s;
    animation: application-loading-rotate 1s;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    animation-timing-function: linear;
}

@-webkit-keyframes application-loading-rotate {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}
@keyframes application-loading-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

在 Google Chrome 中,旋转是稳定的,但在 IE11 中,由于某种原因,圆在旋转时会出现明显的“摆动”。

任何想法为什么它如此摇摆不定?有什么办法可以在 IE11 中修复它?

【问题讨论】:

    标签: css internet-explorer-11


    【解决方案1】:

    对于它的价值,它也发生在其他浏览器上。它必须这样做,边界是如何绘制的,它不是一个完美的圆形。据我所知,没有快速解决此问题的方法。但是,您可以将边框绘制为背景图像。

    .spinner {
    display:block;
        width: 200px;
        height: 200px;
        border-radius: 100%;
        background-image:url(http://www.clipartbest.com/cliparts/9iR/RyK/9iRRyKLie.png);
        background-size:100%;
    
        -webkit-animation: application-loading-rotate 1s;
        animation: application-loading-rotate 1s;
        -webkit-animation-iteration-count: infinite;
        animation-iteration-count: infinite;
        -webkit-animation-timing-function: linear;
        animation-timing-function: linear;
    }
    
    @-webkit-keyframes application-loading-rotate {
      from {
        -webkit-transform: rotate(0deg);
      }
      to {
        -webkit-transform: rotate(360deg);
      }
    }
    @keyframes application-loading-rotate {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
    

    见: http://jsfiddle.net/eQegA/26/

    【讨论】:

    • 谢谢马克。 .png 渲染非常抖动,质量不够好。它给了我一个想法,虽然使用 SVG 来代替弧线,但它在 IE11 中似乎可以很好地渲染和旋转。
    • 是的,SVG 会做得很好。 PNG 只是一个例子。
    猜你喜欢
    • 2016-07-13
    • 2016-09-01
    • 1970-01-01
    • 2015-11-05
    • 1970-01-01
    • 2011-04-16
    • 2014-10-12
    • 1970-01-01
    • 2018-12-13
    相关资源
    最近更新 更多