杯转琉璃 2017-07-17 01:33 采纳率: 16.7%
浏览 1917

css3 定义的动画效果,IE和其他浏览器显示不一致

.magic {
animation: magic 1s linear;
animation-fill-mode: forwards;
}

@keyframes magic {
0% {
opacity: 1;
transform-origin: 50% 0;
transform: scale(1, 1);
}

50% {
opacity: 0.5;
transform-origin: 50% 0;
transform: translate(275px, -60px) scale(0.5, 0.5);
}

100% {
opacity: 0;
transform-origin: 50% 0;
transform: translate(550px, -120px) scale(0, 0);
}
}

  • 写回答

1条回答 默认 最新

  • zhituji 2017-08-21 14:21
    关注

    需要加入厂商前缀提高代码兼容性,例:
    div
    {
    animation-name: myfirst;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-delay: 2s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-play-state: running;
    /* Firefox: /
    -moz-animation-name: myfirst;
    -moz-animation-duration: 5s;
    -moz-animation-timing-function: linear;
    -moz-animation-delay: 2s;
    -moz-animation-iteration-count: infinite;
    -moz-animation-direction: alternate;
    -moz-animation-play-state: running;
    /
    Safari 和 Chrome: /
    -webkit-animation-name: myfirst;
    -webkit-animation-duration: 5s;
    -webkit-animation-timing-function: linear;
    -webkit-animation-delay: 2s;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-direction: alternate;
    -webkit-animation-play-state: running;
    /
    Opera: */
    -o-animation-name: myfirst;
    -o-animation-duration: 5s;
    -o-animation-timing-function: linear;
    -o-animation-delay: 2s;
    -o-animation-iteration-count: infinite;
    -o-animation-direction: alternate;
    -o-animation-play-state: running;
    }

    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件