【问题标题】:Why is my css slider not working in chrome but is working in IE and Fifox为什么我的 css 滑块不能在 chrome 中工作,但在 IE 和 Fifox 中工作
【发布时间】:2015-03-02 07:50:15
【问题描述】:

link towards my slider that i striped out of my webiste

我从一个网站上得到了这个滑块,它在 chrome 中运行,但我在 css 中更改了一些东西,现在它只适用于 IE 和 firefox


在 Chrome 的检查器中,我看到它在 (animation-delay: 0s; 和 animation-delay: 0s;) 上有一些错误

#slider {
margin: 00px auto;
width: 500px;
height: 300px;
overflow: hidden;
position: relative;
}
.photo {
position: absolute;
animation: round 16s infinite;
-webkit-animation:round 16s infinite;
-o-animation:round 16s infinite;
-moz-animation:round 16s infinite;
-ms-animation:round 16s infinite;
opacity: 0;
}
@keyframes round{   
25%{opacity:1;}
  40%{opacity:0;}
}
@-webkit-keyframe round{
  25%{opacity:1;}
  40%{opacity:0;}
}
@-o-keyframes round {
  25%{opacity:1;}
  40%{opacity:0;}
}
@-moz-keyframes round{   
  25%{opacity:1;}
  40%{opacity:0;}
}

@-ms-keyframes round{   
 25%{opacity:1;}
  40%{opacity:0;}
}
img:nth-child(4){animation-delay:0s;}
img:nth-child(3){animation-delay:4s;}
img:nth-child(2){animation-delay:8s;}
img:nth-child(1){animation-delay:12s;}

img:nth-child(4){-webkit-animation-delay:0s;}
img:nth-child(3){-webkit-animation-delay:4s;}
img:nth-child(2){-webkit-animation-delay:8s;}
img:nth-child(1){-webkit-animation-delay:12s;}

img:nth-child(4){-moz-animation-delay:0s;}
img:nth-child(3){-moz-animation-delay:4s;}
img:nth-child(2){-moz-animation-delay:8s;}
img:nth-child(1){-moz-animation-delay:12s;}

img:nth-child(4){-ms-animation-delay:0s;}
img:nth-child(3){-ms-animation-delay:4s;}
img:nth-child(2){-ms-animation-delay:8s;}
img:nth-child(1){-ms-animation-delay:12s;}

img:nth-child(4){-o-animation-delay:0s;}
img:nth-child(3){-o-animation-delay:4s;}
img:nth-child(2){-o-animation-delay:8s;}
img:nth-child(1){-o-animation-delay:12s;}

【问题讨论】:

  • 如果它给您一个错误,您应该在此处发布该消息。

标签: html css google-chrome animation slider


【解决方案1】:

你错过了@-webkit-keyframes的“s”

替换这个

@-webkit-keyframe round{
  25%{opacity:1;}
  40%{opacity:0;}
}

有了这个

@-webkit-keyframes round{
  25%{opacity:1;}
  40%{opacity:0;}
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-07
    • 2019-12-06
    • 1970-01-01
    • 2014-05-24
    相关资源
    最近更新 更多