「content:」のcssアニメーションはSafariとFirefoxでは機能しません

サンドリーナ-p

:beforeChromeで正常に動作するアニメーションを設定していますが、Safari(IOS9iPhoneまたは9-ElCapitan)でもFirefoxでも動作しません。

.hey {
  color: white;
}
.hey:before {
  content: 'Hey \a there';
  white-space: pre;
  position: absolute;
  color: red;
 -moz-animation: heyThere 2250ms steps(11); /* for firefox */
  -webkit-animation: heyThere 2250ms steps(11); /* for safari, chrome & opera */
}

@keyframes heyThere {
    0% {content: "";}
    1% {content: "";}
    75% {content: "";}
    77% {content: "H";}
    80% {content: "He";}
    83% {content: "Hey";}
    85% {content: "Hey ";}
    87% {content: "Hey \a t";}
    90% {content: "Hey \a th";}
    93% {content: "Hey \a the";}
    95% {content: "Hey \a ther";}
    97% {content: "Hey \a there";}
    100% {content: "Hey \a there";}
}
@-moz-keyframes heyThere { /* animation for firefox */
    0% {content: "";}
    1% {content: "";}
    75% {content: "";}
    77% {content: "H";}
    80% {content: "He";}
    83% {content: "Hey";}
    85% {content: "Hey ";}
    87% {content: "Hey \a t";}
    90% {content: "Hey \a th";}
    93% {content: "Hey \a the";}
    95% {content: "Hey \a ther";}
    97% {content: "Hey \a there";}
    100% {content: "Hey \a there";}
}
@-webkit-keyframes heyThere { /* animation for chrome, safari & opera */
    0% {content: "";}
    1% {content: "";}
    75% {content: "";}
    77% {content: "H";}
    80% {content: "He";}
    83% {content: "Hey";}
    85% {content: "Hey ";}
    87% {content: "Hey \a t";}
    90% {content: "Hey \a th";}
    93% {content: "Hey \a the";}
    95% {content: "Hey \a ther";}
    97% {content: "Hey \a there";}
    100% {content: "Hey \a there";}
}
<div class="hey">Hey there</div>

サンドリーナ-p

@asimovwasrightの答えは正しいです。

cssでの繰り返しを避けるために@for、SCSSでaを使用して、使用可能なすべてのスパン(この場合は8)をループしました。

.hey {
    span {
        color: transparent;
        animation: heyThere 500ms ease-out;
        animation-fill-mode: forwards;

        $chars: 8;
        @for $i from 1 through $chars {
            &:nth-of-type(#{$i}) {
                animation-delay: 1200+70ms*$i;
            }
        }
    }
}

そしてHTML:

<h2 class="hey">
   <span>H</span>
   <span>e</span>
   <span>y</span>
   <br>
   <span>t</span>
   <span>h</span>
   <span>e</span>
   <span>r</span>
   <span>e</span>
</h2>

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

CSSアニメーションはFirefoxとIEでは機能しません

分類Dev

SVG <use>のアニメーションはFireFoxとSafariでは機能しません

分類Dev

CSSアニメーションはChromeとSafariで機能しますが、FirefoxとInternetExplorerでは機能しません

分類Dev

CSSアニメーションはChromeで機能しますが、FireFoxでは機能しません

分類Dev

このアニメーション(css3)はFirefoxでは機能しません

分類Dev

jQueryアニメーションは機能しますが、Safariでは機能しません

分類Dev

CSSアニメーションはIEでは機能しません

分類Dev

CSSアニメーションはMozillaでは機能しません

分類Dev

キーフレームを介した複数の背景画像の位置のアニメーションは、ChromeとSafariでは機能しますが、Firefoxでは機能しません

分類Dev

入力テキストのアニメーションはFirefoxでは機能しません

分類Dev

Hover.cssライブラリアニメーションはFirefoxまたはEdgeでは機能しませんが、Chromeでは機能しますか?

分類Dev

アニメーションが一時停止しているときにjQueryを使用してアニメーションの遅延を変更することは、Safariでは機能しませんが、それ以外の場所では機能します。

分類Dev

`display:none`はcssアニメーションで機能しませんか?

分類Dev

SVGアニメーションはMozillaでは機能しませんが、ChromeとSafariでは機能します

分類Dev

CSSアニメーションがFirefoxで機能しませんか?

分類Dev

CSS3アニメーションはChromeでは機能しませんがFirefoxでは機能します

分類Dev

アニメーションの scrollTop は Chrome では機能しませんか?

分類Dev

cssアニメーションと-moz-は絶対ブロックでは機能しません

分類Dev

css遷移アニメーションはsvgパスの「d」属性の変更では機能しません

分類Dev

不透明度が0から1のアニメーションは、FireFoxでは機能しませんが、Chromeでは機能します

分類Dev

svg塗りつぶしアニメーションはFirefoxでは機能しません

分類Dev

CSS3 アニメーションは、iOS Safari の Codepen でのみ機能します。

分類Dev

CSS3アニメーションはIE11では機能しませんが、他のブラウザーでは機能します

分類Dev

アニメーションSVGはFirefoxでは機能せず、Chromeでは機能します

分類Dev

アニメーション転送は:hoverでは機能しません

分類Dev

ReorderableListView内では、CheckBoxアニメーションは機能しません

分類Dev

Tkinterアニメーションは機能しません

分類Dev

cssアニメーションは新しいdom要素では機能しません

分類Dev

nth-child(an + b):ホバーはCSSアニメーションでは機能しませんか?

Related 関連記事

  1. 1

    CSSアニメーションはFirefoxとIEでは機能しません

  2. 2

    SVG <use>のアニメーションはFireFoxとSafariでは機能しません

  3. 3

    CSSアニメーションはChromeとSafariで機能しますが、FirefoxとInternetExplorerでは機能しません

  4. 4

    CSSアニメーションはChromeで機能しますが、FireFoxでは機能しません

  5. 5

    このアニメーション(css3)はFirefoxでは機能しません

  6. 6

    jQueryアニメーションは機能しますが、Safariでは機能しません

  7. 7

    CSSアニメーションはIEでは機能しません

  8. 8

    CSSアニメーションはMozillaでは機能しません

  9. 9

    キーフレームを介した複数の背景画像の位置のアニメーションは、ChromeとSafariでは機能しますが、Firefoxでは機能しません

  10. 10

    入力テキストのアニメーションはFirefoxでは機能しません

  11. 11

    Hover.cssライブラリアニメーションはFirefoxまたはEdgeでは機能しませんが、Chromeでは機能しますか?

  12. 12

    アニメーションが一時停止しているときにjQueryを使用してアニメーションの遅延を変更することは、Safariでは機能しませんが、それ以外の場所では機能します。

  13. 13

    `display:none`はcssアニメーションで機能しませんか?

  14. 14

    SVGアニメーションはMozillaでは機能しませんが、ChromeとSafariでは機能します

  15. 15

    CSSアニメーションがFirefoxで機能しませんか?

  16. 16

    CSS3アニメーションはChromeでは機能しませんがFirefoxでは機能します

  17. 17

    アニメーションの scrollTop は Chrome では機能しませんか?

  18. 18

    cssアニメーションと-moz-は絶対ブロックでは機能しません

  19. 19

    css遷移アニメーションはsvgパスの「d」属性の変更では機能しません

  20. 20

    不透明度が0から1のアニメーションは、FireFoxでは機能しませんが、Chromeでは機能します

  21. 21

    svg塗りつぶしアニメーションはFirefoxでは機能しません

  22. 22

    CSS3 アニメーションは、iOS Safari の Codepen でのみ機能します。

  23. 23

    CSS3アニメーションはIE11では機能しませんが、他のブラウザーでは機能します

  24. 24

    アニメーションSVGはFirefoxでは機能せず、Chromeでは機能します

  25. 25

    アニメーション転送は:hoverでは機能しません

  26. 26

    ReorderableListView内では、CheckBoxアニメーションは機能しません

  27. 27

    Tkinterアニメーションは機能しません

  28. 28

    cssアニメーションは新しいdom要素では機能しません

  29. 29

    nth-child(an + b):ホバーはCSSアニメーションでは機能しませんか?

ホットタグ

アーカイブ