Показать сообщение отдельно
  #3 (permalink)  
Старый 21.01.2016, 10:32
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,068

animationend and toggleClass
Shadow_ua,

<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  .list-button  {
     border: 5px solid Blue;

  }
  .loader-button {
    -webkit-animation: color .5s ease-in-out 4;
	-moz-animation: color .5s ease-in-out 4;
	-o-animation: color .5s ease-in-out 4;
	animation: color .5s ease-in-out 4;
  }

  #button{
   border-radius: 8px;
   background: #696969;
   font-size: 48px;
   color: #FFFFFF;
   width:100px;
   height:100px;
}
 #button:focus{
    outline:  none;
}
    @keyframes color {
      0% {
        background-color: #FF0000;
      }
      17%{
         background-color: #FFA500;
      }
      34%{
         background-color:  #FFFF00;
      }
     51%{
         background-color:  #008000;
      }
	68% {
		  background-color:  #0000FF;
	}
   85%{
         background-color:  #000080;
   }
   100%{
     background-color: #800080;
   }

}
@-webkit-keyframes color {
  0% {
        background-color: #FF0000;
      }
      17%{
         background-color: #FFA500;
      }
      34%{
         background-color:  #FFFF00;
      }
     51%{
         background-color:  #008000;
      }
	68% {
		  background-color:  #0000FF;
	}
   85%{
         background-color:  #000080;
   }
   100%{
     background-color: #800080;
   }
}

  </style>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script>
     $(function(){
 $('#button').on({'click': function(){
    $(this).toggleClass('loader-button list-button');
},'webkitAnimationEnd animationend' : function() {
    $(this).trigger('click')
}});
});


  </script>
</head>

<body>

<input id="button" name="" type="button" value="go" class="list-button">

</body>

</html>
Ответить с цитированием