Start a css animation on button click

前端 未结 5 828
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 21:25

Hi I\'ve been looking for answers on my problem now for maybe a few weeks now and I find nothing. I\'m trying to make a reaction test to check how long time it takes for the

5条回答
  •  醉梦人生
    2021-01-05 21:58

    Here the sample for you

    #first-child {
      height: 200px;
      width: 200px;
      background: white;
      border-radius: 0%;
      margin-top: 150px;
      margin-bottom: 0px;
      margin-left: 500px;
      margin-right: 0px;
      -webkit-animation: myfirst 1s;
      animation: myfirst 1s;
      }
    @-webkit-animation myfirst {
        0% {background: white;}
       20% {background: white;}
       40% {background: white;}
       60% {background: white;}
       80% {background: white;}
      100% {background: red;}
      }
    
    .second-parent {
      margin-top: 0px;
      margin-bottom: 0px;
      margin-left: 415px;
      margin-right: 0px;
      }
    
    
    
    
    
    
      

    ==> please add the jquery library in the , you can download lirabry in: http://jquery.com/download/

提交回复
热议问题