2017-02-07 19 views
0

今夜はFirefox用にCSSタイプのアニメーションを修正しようとしています。 Chromeコードが動作します。私は何を失っているのですか?FirefoxのCSSタイピングアニメーションが機能しない

.css-typing 
{ 
    width: 680px; 
    white-space: nowrap; 
    overflow: hidden; 
    -webkit-animation: type 3s steps(50, end); 
    animation: type 3s steps(55, end); 
    -o-animation: type 5s steps(50, end); 
    -moz-animation: type 3s steps(55, end); 
    } 


@keyframes type 
    { 
     from { width: 0; } 
    } 

@-moz-keyframes type 
    { 
     from { width: 0; } 
    } 

@-webkit-keyframes type 
    { 
     from { width: 0; } 
    } 

このコードで定義する必要がありますdiv要素は次のようになります。

<div class='css-typing'>This text will pop up using an typewriting effect</div> 

誰もが私の間違いを見つけていますか?

+0

「div」には '.css-typing'がありません。 – TricksfortheWeb

+0

typo ...言われたように、それはクロムで動作するので –

答えて

1

あなたは@keyframesブロックのto一部を設定する必要があります。また、要素の幅を設定する必要があります:https://jsfiddle.net/yak613/vtdyuju4/

.css-typing { 
    width: 360px; 
    white-space: nowrap; 
    overflow: hidden; 
    -webkit-animation: type 3s steps(50, end); 
    animation: type 3s steps(55, end); 
    -o-animation: type 5s steps(50, end); 
    -moz-animation: type 3s steps(55, end); 
} 


@keyframes type 
    { 
     from { width: 0; } 
     to { width: 360px; } 
    } 

@-moz-keyframes type 
    { 
     from { width: 0; } 
     to { width: 360px; } 
    } 

@-webkit-keyframes type 
    { 
     from { width: 0; } 
     to { width: 360px; } 
    } 
+0

ええと、これはまだ動作していないようです= /私のfirefoxのバージョンは2日前です。 –

+0

私はUbuntu 16.01のFirefox 51でそれをテストし、うまくいきました。見落としているものがないと確信していますか? – TricksfortheWeb

+0

私は今チェックしています。フィドルコードは私のために働くが、私のコードはfirefoxで何もしないようだ。 おそらくそれはワードプレスのことですが、わかりません。これを理解しようとしています。 ご協力ありがとうございます。 –

0

W3Cが最高のブラウザのサポートのために推奨していますが、「から」とその " 〜 "は両方とも内に定義されています@keyframes。コードを次のように変更してみてください:

.css-typing 
{ 
    width: 680px; 
    white-space: nowrap; 
    overflow: hidden; 
    -webkit-animation: type 3s steps(50, end); 
    animation: type 3s steps(55, end); 
    -o-animation: type 5s steps(50, end); 
    -moz-animation: type 3s steps(55, end); 
    } 


@keyframes type 
    { 
     from { width: 0; }, 
     to {width:680px} 
    } 

@-moz-keyframes type 
    { 
     from { width: 0; }, 
     to {width:680px} 
    } 

@-webkit-keyframes type 
    { 
     from { width: 0; } 
     to {width:680px} 
    } 
関連する問題