以下のようなコードを見つけたのですが
- .5sは開始時間の指定かと思いますが、0.5sの0を省略何でしょうか(前半のコード)?
- また、開始時間を設定しない場合、animationがカクカクするのですが(後半のコード)、これは開始時間で解消すべきなのかコード自体に問題があるのでしょうか?
よろしくお願い申し上げます
css
1b1 { 2 left: 0; 3 animation: anim 2.5s ease .5s; 4}
html
1<div style="display:flex;"> 2 <div class="left_rand_default" style="height:50px;bacground:blue;"></div> 3 <div class="right_rand_default" style="height:50px;bacground:green;"></div> 4<div>
css
1 <?php 2 $rand1=rand(1,100); 3 $rand2=rand(1,100); 4 $rand3=rand(1,100); 5 ?> 6 7 .left_rand_default{ 8 width:<?php echo $rand1;?>%; 9 } 10 11 .right_rand_default{ 12 width:<?php echo 100-$rand1;?>%; 13 } 14 15 .left_variance{ 16 animation: lv 5s ease .5s forwards; 17 } 18 @keyframes lv{ 19 33%{ 20 width:<?php echo $rand2;?>%; 21 } 22 66%{ 23 width:<?php echo $rand3;?>%; 24 } 25 100%{ 26 width:90%; 27 } 28 } 29 30 .right_variance{ 31 animation: rv 5s ease .5s forwards; 32 } 33 34 @keyframes rv{ 35 33%{ 36 width:<?php echo 100-$rand2;?>%; 37 } 38 66%{ 39 width:<?php echo 100-$rand3;?>%; 40 } 41 100%{ 42 width:10%; 43 } 44 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/06 07:25