css - Webkit 转换 : rotate

标签 css css-transitions css-animations

我有一个代码:

HTML:

<section class="progress">
    <div class="spinner icon-spinner" aria-hidden="true"></div>
  <p class="label">Loading</p>
</section>

CSS:

@font-face {
    font-family: 'icomoon';
    src:url('http://s3.amazonaws.com/icomoonfonts/4/6/f.eot');
    src:url('http://s3.amazonaws.com/icomoonfonts/4/6/f.eot?#iefix') format('embedded-opentype'),
        url('http://s3.amazonaws.com/icomoonfonts/4/6/f.woff') format('woff'),
        url('http://s3.amazonaws.com/icomoonfonts/4/6/f.ttf') format('truetype'),
        url('http://s3.amazonaws.com/icomoonfonts/4/6/f.svg#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}

.icon-spinner:before {
    font-family: 'icomoon';
    speak: none;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    content: "\e002";
}

@keyframes anim-rotate {
    0% {
        transform: rotate(0);
    opacity: 1;
    }
  50% {
    opacity: .7;
  }
    100% {
        transform: rotate(359deg);
    opacity: 1;
    }
}
.spinner {
    display: inline-block;
    font-size:64px;
    height: 64px;
    line-height: 1;
    margin: .1em;
    animation: anim-rotate 3s infinite linear;
    color: rgba(223,78,107, 1);
}
body {
  text-align: center;
    line-height: 1.5;
    background: #fff;
}
.progress {
  margin:2em;
}
.progress .label {
  color:#777;
  margin:0;
  font-size:16px;
  font-family: Tahoma,Verdana,sans-serif;
}

例子: http://codepen.io/anon/pen/BfKaA/

为什么这个旋转(0度); -> rotate(359deg); 在旋转期间在 Chrome 中摇晃? FF 中的这个示例正在运行。任何人都可以在那里更改代码以获得 Chrome 中的平滑旋转吗?

最佳答案

试试看...

  @keyframes anim-rotate {
    0% {
        transform: rotate(0);
    opacity: 1;
    }
  50% {
    opacity: 1;
  }
    100% {
        transform: rotate(360deg);
    opacity: 1;
    }

关于css - Webkit 转换 : rotate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23062836/

相关文章:

Javascript 查找和替换 Div

javascript - 在 Javascript 中设置 CSS 3 转换和转换在 Chrome 中有效,但在 IE 10、FF 中不能正常工作?

css - 如何为底部 : value to bottom: auto 设置动画

html - 如何定位我的弹出窗口?

html - 使用 Font Awesome 在按钮 div 中显示箭头

html - 在向左浮动且具有最小高度的 div 中垂直居中图像

css - 使用 CSS Padding Hover Transition 的闪烁文本问题

javascript - CSS Transitions 在参数化函数中不起作用

javascript - Css 或 Jquery 中图像的动画光反射

javascript - 通过 JS 触发的 CSS 动画仅每隔一次点击播放一次