简体   繁体   English

CSS animation 在桌面上工作,但不是在移动设备上工作?

[英]CSS animation is working on desktop but not mobile?

I'm using a keyframes animation for a changing word carousel.我正在使用关键帧 animation 来更改单词轮播。 It is working perfectly on desktop, but the animation doesn't work at all on mobile.它在台式机上运行良好,但 animation 在移动设备上根本无法运行。 I have tried both Safari and Chrome on mobile (and so has another user) and neither is working.我已经在移动设备上尝试过 Safari 和 Chrome(其他用户也是如此),但都没有工作。 Any help would be immensely appreciated, Also.任何帮助将不胜感激,也。 the pieces of span content I am using are just placeholders.我使用的跨度内容只是占位符。

 .carousel { display: inline-block; }.carousel h3 { font-family: 'Space Mono', monospace; font-size: 2.1rem; font-weight: 400; line-height: 1.7em; }.carousel h3:before{ content: 'architecture'; -webkit-animation: animate 10s linear infinite; } @-webkit-keyframes animate { 0%, 100%{ content: 'architecture'; } 20%{ content: 'illustration'; } 40%{ content: 'x'; } 60%{ content: 'y'; } 80%{ content: 'z'; } }
 <span class="hero-italic">My work is inspired by </span><span class="carousel"><h3></h3></span>.</h1>

Using in animationanimation中使用


-webkit-animation: animate 10s linear infinite; /* Safari 4+ */
-moz-animation:    animate 10s linear infinite; /* Fx 5+ */
-o-animation:      animate 10s linear infinite; /* Opera 12+ */
 animation:         animate 10s linear infinite; /* IE 10+, Fx 29+ */

Using in keyframeskeyframes中使用


 @-webkit-keyframes animate {
    ------------------------
    ------------------------
 }
 
 @-moz-keyframes animate {
    ------------------------
    ------------------------
 }
 
 @-o-keyframes animate {
    ------------------------
    ------------------------
 }
 
 @keyframes animate {
    ------------------------
    ------------------------
 }

 .carousel { display: inline-block; }.carousel h3 { font-family: 'Space Mono', monospace; font-size: 2.1rem; font-weight: 400; line-height: 1.7em; }.carousel h3:before{ content: 'architecture'; -webkit-animation: animate 10s linear infinite; -moz-animation: animate 10s linear infinite; -o-animation: animate 10s linear infinite; animation: animate 10s linear infinite; } @-webkit-keyframes animate{ 0%, 100%{ content: 'architecture'; } 20%{ content: 'illustration'; } 40%{ content: 'x'; } 60%{ content: 'y'; } 80%{ content: 'z'; } } @keyframes animate{ 0%, 100%{ content: 'architecture'; } 20%{ content: 'illustration'; } 40%{ content: 'x'; } 60%{ content: 'y'; } 80%{ content: 'z'; } } @-moz-keyframes animate{ 0%, 100%{ content: 'architecture'; } 20%{ content: 'illustration'; } 40%{ content: 'x'; } 60%{ content: 'y'; } 80%{ content: 'z'; } } @-o-keyframes animate { 0%, 100%{ content: 'architecture'; } 20%{ content: 'illustration'; } 40%{ content: 'x'; } 60%{ content: 'y'; } 80%{ content: 'z'; } }
 <span class="hero-italic">My work is inspired by </span><span class="carousel"><h3></h3></span>.</h1>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM